Help me in this project


Dear all,

I did Product catalog, it contents intro and supportive files (.swf) how to give non editable file to them. or it should ask to install to run this catalog but the supportive file should not visible and edit.

Posted On: Thursday 3rd of January 2013 10:20:30 PM Total Views:  224
View Complete with Replies

RELATED TOPICS OF Flash / ActionScript PROGRAMMING LANGUAGE




movie clip on flas slide presentation

hi there!! i've been doing a flash slide presentation and i want to add a movie trailer from youtube..what will i do\t need help asap
VIEWS ON THIS POST

49

Posted on:

Friday 30th November 2012
View Replies!

random graphics

I am trying to make an intro page using flash. I have a spotlight that bounces off the sides of the virtual "walls". I want random graphics to appear in the spotlight with a pause between each graphic. How can I do this
VIEWS ON THIS POST

77

Posted on:

Friday 30th November 2012
View Replies!

Connecting URL from Flash Movie so web site

I built a movie using Flash 8. It has buttons to connect to inline frames in my site. I used the properties menu and entered the iflash page and _self. I understand I also have to have support from ActionScript. I have tried the global lines with no success. My last attempt was: getURL("IFRAME_0.HTML", cont"); Can someone help this 71 year old novice Bob
VIEWS ON THIS POST

60

Posted on:

Friday 30th November 2012
View Replies!

move the scrollbar while i scrolling the text by rolling mouse wheel

hi I am create a scroll bar for dynamic text box in as 1.0. if i drag the scroll bar the text box in scrolling. i want to move the scrollbar while i scrolling the text by rolling mouse wheel. this is code for scrollbar_movieclip QuoteonClipEvent (load) { setProperty(this, _x, int(_x)); } onClipEvent (enterFrame) { a = new Object(); a.y = this._y; a.x = this._x; _parent.path.globalToLocal(a); b = int(a.y/(100/_parent.textvar.maxscroll)); }
VIEWS ON THIS POST

61

Posted on:

Friday 30th November 2012
View Replies!

Linking text boxes.

I made a flash site, and i'm adding a passworded section to it. And on a section that the public can see i added an input text box, on the passworded section, i want what was inputted to be displayed, also how do i clear the list on the passworded section. Can anyone help with the codeing This post has been edited by Dilerious: 02 August 2006 - 10:30 AM
VIEWS ON THIS POST

46

Posted on:

Friday 30th November 2012
View Replies!

How To Do A Preload/loading In Flash

I'm a newbie to Flash MX (its my first flash program) and I was wondering how those neat preloading/loading flash files/pages are created. For example just a basic one like at http://www.fontsforflash.com.
VIEWS ON THIS POST

51

Posted on:

Friday 30th November 2012
View Replies!

I finally got flash

allright, i finally got flash and am just beginning to fool around with it, what i was wondering was if someone could tell me how to make it so that my design was an exact number of pixels. ex: 500 x 100
VIEWS ON THIS POST

65

Posted on:

Friday 30th November 2012
View Replies!

Drag and Snap Tile : AS3

friends.... Anybody know how to drag a tile clip and snap to its adjacent clips in a game like this
VIEWS ON THIS POST

68

Posted on:

Friday 28th December 2012
View Replies!

Cursor over dynamic textfield fails to track

I am having a problem and i am not sure what to do although the answer must be obvious.. I have a movieclip and inside the movieclip a dynamic text field. I want to move the moveclip when my cursor is inside it but the problem is the area of the textfield isn't recognized as part of the movieclip although its in it. This results the movieclip to stop when the cursor touches the textfield area. Any suggestions
VIEWS ON THIS POST

51

Posted on:

Friday 28th December 2012
View Replies!

When mc hits stage boundary - transfer to opposite edge

I have an mc which moves on pressing buttons. I want it to come to the left of the stage if it hits the right end. Simple, isn't it But I want to have one move thing done. I want only that part of the mc to come to the left which has hit the boundary. For example, Let this be the mc- Code: ---- | | | | ---- When half of it hits the right end, only half should be transferred to the left end. Code: -- -- | | | | -- -- Please help.
VIEWS ON THIS POST

51

Posted on:

Friday 28th December 2012
View Replies!

wierd array bug

so i want to create an array with a single member of array which is variable i call j:int; so i do smoething like this: var j:int = 0; var ar:array = new array(j); trace(ar); and it appears as if array ar is blank = than i have tried some testing and found out that if i try to push it it will work just fine... but why doesn't it work the way it is, am I right it is a bug
VIEWS ON THIS POST

43

Posted on:

Friday 28th December 2012
View Replies!

countdown flashvars problem

Hi im using a coundown from server to flash but if i test the countdown using 2 laptops there is always a time difference between the two laptops, i need to get the same time, here is my code can anyone see the problem. i have rattled my head with this for seven days and still can't find the answer please someone help me here. here is my php code with the embeded flash PHP Code: \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
VIEWS ON THIS POST

64

Posted on:

Saturday 29th December 2012
View Replies!

Flash opening explorer folder in flash cs4

how do open explorer folder in flash cs4 not in internet browsers. please help me
VIEWS ON THIS POST

49

Posted on:

Saturday 29th December 2012
View Replies!

Child targeting Parent - AS3

Would someone please help me to correctly get a LOADED SWF to target a LOADER SWF I have a button in the LOADED SWF that "addChild" to the LOADER SWF. I have the following action in the LOADED SWF: stage.root.parent.addChild(button_btn); It doesn't work and the error message is: "Access of undefined property button_btn"
VIEWS ON THIS POST

54

Posted on:

Saturday 29th December 2012
View Replies!

Best Way to Store and Parse XML between classes??

Hi Guys, I've been working in as3 for quite a while now, playing about with various methods of loading in and parsing XML between classes - from storing the XML data using objects, storing it in arrays, or parsing XML nodes directly between their relevant classes. What I'm really trying to figure out is how best to store - and parse, externally loaded XML throughout my custom classes. Say, for example, I have an XML file in which I contain my 'gallery' and 'navigation' settings. What I'm currently doing is loading in the XML, extracting all the attributes in my document class into objects - that I then parse to their related classes for data extraction. i.e. public class myNavigation extends MovieClip { public function myNavigation(navSettings:Object) { this.x = navSettings.xpos this.x = navSettings.ypos } } (where navSettingsis the object parsed to the navigation class) ...Simply put, what is the best way to store and parse XML data between classes Should I be extracting it all in the document class first, into arrays, or objects Or simply parsing XML nodes that relate to my custom class, to the class directly I've also heard that looping through XML and storing the data in multi-dimentional arrays that you then parse to your classes is the way to go.. i.e. var navSettingsArray = new Array([display[xpos, ypos]] var myNav:navigationClass = new navigationClass(navSettingsArray[0][0], navSettingsArray[0][1] etc..)
VIEWS ON THIS POST

42

Posted on:

Sunday 30th December 2012
View Replies!

Remote Loading

I have written a game library for the company I work for, which gets remotely downloaded from our servers. This all works fine, the problem is I am trying to integrate a third party API into our API which works in the same way. So what happening is Game.swf -> Downloads API.swf -> API.swf -> Downloads ThirdPartyAPI.swf The problem is, this spits out a whole bunch of security issues stating that ThirdPartyAPI.swf can not access the stage on Game.swf as its not the owner or something along those lines. I have changed the crossdomain on API.swf's domain to allow all which had no effect. How can I get around this Dave.
VIEWS ON THIS POST

44

Posted on:

Sunday 30th December 2012
View Replies!

URLRequest for external jpegs

... This should be simple but it has had me stuck for a while. I'm trying to click a button or thumbnail to open a jpeg. The jpgs are external and bigger than the stage dimensions. When previewing the swf, it works just fine. The jpegs open in Preview. But... when the swf is embed in the html file, the jpeg can't be located. Is there an issue with the my code or is something. Here is some sample code: Code: zagat_btn.addEventListener(MouseEvent.CLICK, zagatThumbFunction); function zagatThumbFunction(e:MouseEvent){ navigateToURL(new URLRequest("zagat.jpg")); }
VIEWS ON THIS POST

52

Posted on:

Sunday 30th December 2012
View Replies!

Loading XML from exe file query

I have a Flash movie exported as an exe file, that loads information from an XML file situated on a server, like so: var urlLoader:URLLoader = new URLLoader(); var urlReq:URLRequest = new URLRequest("http://server.mydomain.co.uk/info.xml"); urlLoader.addEventListener(Event.COMPLETE, loadXML); urlLoader.load(urlReq); I'm testing the exe from my desktop and it's working fine, calling the URLs in my default browser. I would like to ask, will the exe work from any machine with internet access Or are there likely to be problematic security issues I haven't had to change any security settings for the exe to work on my PC. I'm sure the answer to this issue is already on the forum somewhere, but I just want to make sure that there are not likely to be any problems in my particular situation (zero margin for error with these clients!).
VIEWS ON THIS POST

43

Posted on:

Sunday 30th December 2012
View Replies!

[papervision] Scaling from other Cube point??

I am testing with scaling a cube, like so Code: private function growCube():void { TweenLite.to(cube3, 2, {scaleX:1.5 , scaleY:1.5, scaleZ:1.5} ); } But it scales from the center point (0,0,0) , i like to scale from front right bottom. For a 300,300,300 that would be (150,150,150 ) How can i accomplish this
VIEWS ON THIS POST

49

Posted on:

Sunday 30th December 2012
View Replies!

Flash How do you load several instances of a symbol into one class at once.

I'm basically making a platforming game, and the platforms are exported into one class. There are currently 2 instances of the platform symbol in a movieclip which is the level. How would I load up the platforms class where it loads all the instances of the platform and load them into an array during the process This is the constructor of the class: public function PlatformTest() { _top = GetTop(); _bottom = GetBottom(); _left = GetLeft(); _right = GetRight(); _platformList[_getSet.ListCntr] = this; _getSet.ListCntr++; } I have private functions to get the x and y values for collision pruposes, and it loads into an array and is incremented by one. Is this the correct way of doing it
VIEWS ON THIS POST

61

Posted on:

Sunday 30th December 2012
View Replies!

Flash FXON (Flash XML Object Notation) Project

, I just started an open source project @ Google Code. I came up with this simple notation for a recent project. I have since used it on several projects and am happy to share it with anyone else who might benefit. I could also use a hand with the documentation and also features if anyone is interested in helping out. Take a look and feel free to provide feedback. http://code.google.com/p/as3-fxon/
VIEWS ON THIS POST

48

Posted on:

Sunday 30th December 2012
View Replies!

Flash stage align for every child

http://www.mattwiggins.net/ i wanna know how he did when resizing the browser all the child are still in there alignment i think its about no_scale in different child and stage.
VIEWS ON THIS POST

36

Posted on:

Sunday 30th December 2012
View Replies!

Problem with random pickFromArray. It sometimes removes an image already placed.

, I have a class associated to my movie, and a second class that defines my thumbnail. The thumbnail definition class (ScreenButtonScript) places the background image at child level 0, places a random image from my array at child level 1, and finally places the invisible hitplates that detect mouse movements at child level 3. Every time a new instance of (ScreenButtonScript) is called from my main class it places a new thumbplate with a new image and one of the already loaded and placed thumbplates will lose its image picked from the array. I am always placing 6 instances of the thumbplate on the stage through the main class, and I always lose one of the images at child Level 1 of one of the thumbplates. In the ScreenButtonScript, I shuffle my array of 16 images and then pick from that array to place an image on the thumbplate instance. It works perfectly most of the time. Sometimes, however, one of the already loaded images gets removed from the array Therefore it is removed from its image plate during another shuffle pass. I am loading images on to 6 plates, so the shuffle runs 6 times. Here is my shuffle code: Code: public function shuffleArray(input:Array):void { for (var i:int = input.length - 1; i > 0; i--) { var randomIndex:int = Math.floor(Math.random() * (i + 1)); var itemAtIndex:Object = input[randomIndex]; input[randomIndex] = input[i]; input[i] = itemAtIndex; } } Does anyone see a way that I can avoid already placed images from getting removed Here is the PickFromArray code I am using, in case the issue is in there: Code: public function pickFromScreenArray():void { trace("Grab a New Image"); var imageArray:Array = ["AssassImageSA", "AssassImageSB", "AssassImageSC", "AssassImageSD", "AssassImageSE", "AssassImageSF", "AssassImageSG", "AssassImageSH", "AssassImageSI", "AssassImageSJ", "AssassImageSK", "AssassImageSL", "AssassImageSM", "AssassImageSN", "AssassImageSO", "AssassImageSP", "AssassImageSQ"]; shuffleArray(imageArray); addChildAt(LoaderMax.getContent(imageArray[0]), 1); var currentImage:DisplayObject = getChildAt(1); currentImage.alpha = 0; TweenMax.fromTo(currentImage, 2, {autoAlpha: 0}, {autoAlpha: 1, ease: Quad.easeIn}); }
VIEWS ON THIS POST

81

Posted on:

Sunday 30th December 2012
View Replies!

AIR Unable to play the current frame actionscript 3

I have a problem on playing the current frame. which means to replay the frame. I have need to play back the frame 5, however it end up on playing the frame 6 which is the next frame. I couldnt brain this as I am stuck! Helppp function reset(event:MouseEvent):void { gotoAndPlay(5); }
VIEWS ON THIS POST

61

Posted on:

Sunday 30th December 2012
View Replies!

Help with Bullet ricochet!

Ok i made a tank that can move and shoot but i want the bullet to bounce or "ricochet" off the walls so i gave it a shot but.. the bullet bounces off the wall but after i shoot a couple they all suddenly are in sync heres my code.. PHP Code: functionmouseDown(pEvent){\t\tif(amo>=1)\t\t{\t\t\t\tvarb=newBullet();\t\t\t\tb.x=myTank.x;\t\t\t\tb.y=myTank.y;\t\t\t\tamo-=\t1;\t\t\t\tb.angleRadian=Math.atan2(mouseY-myTank.y,mouseX-myTank.x);\t\t\t\tb.addEventListener(Event.ENTER_FRAME,bulletEnterFrame);\t\t\t\taddChild(b);\t\t}}functionbulletEnterFrame(pEvent){\t\t\t\tvarb=pEvent.currentTarget;\t\tb.x+=\tMath.cos(b.angleRadian)*speed;\t\tb.y+=\tMath.sin(b.angleRadian)*speed;\t\tb.rotation=b.angleRadian*180/Math.PI;\t\tif(b.y
VIEWS ON THIS POST

78

Posted on:

Sunday 30th December 2012
View Replies!

Flash Need help with GotoAndPlay action

I have a simple script that plays a short movie clip and I'm trying to add a button to run the clip. So, user clicks button > movie clip plays. It doesn't have to pause the clip or anything, the only thing I care about is that the video starts off paused, I click the button and it plays the video. I have no idea what I'm doing but this is the code I added after looking around on (release) { _root.intro.gotoAndPlay(1,2); } //intro is the name of my movie clip My button is in layer 1, frame 1. Movie clip starts on layer 2, frame 2. Please see the attached screenshot. Can anyone please help me figure out how to make the clip play on button click It would make my day!!
VIEWS ON THIS POST

59

Posted on:

Sunday 30th December 2012
View Replies!

Flash call function from class

I have created a class in which i have created instance of a movie clip. see my code Code: package { import flash.display.MovieClip; import flash.events.Event; import flash.display.StageAlign; import flash.display.StageScaleMode; public class BeeAnimation extends MovieClip { private var bee0:Bee; private var bee1:Bee; private var vx1:Number=5; private var vx2:Number=5; public function BeeAnimation() { // constructor code init(); function init():void{ stage.scaleMode=StageScaleMode.NO_SCALE; stage.align=StageAlign.TOP_LEFT; bee0=new Bee(); addChild(bee0); bee0.x=0; bee0.y=30; bee1=new Bee(); addChild(bee1); bee1.x=-140; bee1.y=30; addEventListener(Event.ENTER_FRAME,onEnterFrame); } function onEnterFrame(event:Event):void{ bee0.x+=vx1; bee1.x+=vx2; var left:Number=0; var right:Number=stage.stageWidth; var top:Number=0; var bottom:Number=stage.stage.stageHeight; if(bee0.x+bee0.width>right) { bee0.x=-300; } if(bee1.x+bee1.width>right) { bee1.x=-10; } } } } Now i want play this movieclip on particular frame. say frame 10 . so how can i do that
VIEWS ON THIS POST

54

Posted on:

Sunday 30th December 2012
View Replies!

Flash Form Help

! I am new to writing ActionScript and I'm designing a customer form for my web site. I am using multiple textInput's, Dropdown boxes and check boxes. Here is some of the code I have now for this form: http://www.delcocs.com/index.php/flash-service-request. How does it look so far . . remember, I am new to this and just want to get my form working before I go crazy with checking things and all that. Code: package { import flash.display.*; import flash.events.*; import flash.text.*; import flash.net.*; public class Main extends MovieClip { public function Main() { addEventListener(Event.ADDED_TO_STAGE,init); } private function init(evt:Event):void { removeEventListener(Event.ADDED_TO_STAGE,init); trace("My Document Class has been created correctly"); form_mc.btnSubmit.addEventListener(MouseEvent.MOUSE_DOWN,checkFields); } private function checkFields(evt:MouseEvent):void { if(form_mc.txtFirstName.text!=""&&form_mc.txtLastName.text!=""&&form_mc.txtAddress.text!=""&&form_mc.txtCity.text!=""&&form_mc.txtZip.text!=""&&form_mc.txtEmail.text!=""&&form_mc.txtPhone.text!=""&&form_mc.txtDate.text!=""&&form_mc.txtTime.text!="") sendMessage(); } private function sendMessage():void { var variables:URLVariables=new URLVariables(); variables.name=form_mc.txtFirstName.text; variables.message=form_mc.txtLastName.text; variables.message=form_mc.txtAddress.text; variables.message=form_mc.txtAddressTwo.text; variables.message=form_mc.txtCity.text; variables.message=form_mc.txtZip.text; variables.email=form_mc.txtEmail.text; variables.message=form_mc.txtPhone.text; variables.message=form_mc.txtDate.text; variables.message=form_mc.txtTime.text; variables.message=form_mc.taInfo.text; var request:URLRequest=new URLRequest(); request.url='sendMail.php'; request.method=URLRequestMethod.POST; request.data=variables; var loader:URLLoader=new URLLoader(); loader.dataFormat=URLLoaderDataFormat.VARIABLES; loader.addEventListener(Event.COMPLETE,messageSent); try { loader.load(request); } catch (error:Error) { trace('Unable to load requested document.'); } } private function messageSent(evt:Event):void { var loader:URLLoader=URLLoader(evt.target); var vars:URLVariables=new URLVariables(loader.data); if(vars.answer=="ok") trace("The message has been sent"); else trace("Something wrong"); } } }
VIEWS ON THIS POST

55

Posted on:

Monday 31st December 2012
View Replies!

Loading only the objects you need

So I was reading up on AS3, OOP and optimization of performance for non-PC applications such as those for iPhones, Androids and whatnot. PROBLEM: UNLOADING AND LOADING ONLY WHAT I NEED I read somewhere that if I had a large map, for example, and a player walking around it, I don't need to load the whole map. If I loaded everything, it would reduce the performance of the application. I don't know what category this inquiry falls into (most probably optimization) but I really want to know how to load and unload bits and parts of a large movie clip that I would consider a map. Instead of using a Physics Engine (which still completely baffles me), my concept of a 2D side-scrolling platformer game would have a player and a large map with platforms that I can interact with. How do I do this I don't think doing removeChild is the way to have a static designed map loaded the same way over and over again. What advice do you have for me Should I learn to use the Physics Engine instead (Box2DAS is confusing and the documentation isn't quite updated) Or continue with this plan of mine
VIEWS ON THIS POST

45

Posted on:

Monday 31st December 2012
View Replies!

I need flash canvas menu ...

.. I need an flash canvas menu, written in AS3... In any shape, any type, it doesn't matter... Please help...
VIEWS ON THIS POST

61

Posted on:

Monday 31st December 2012
View Replies!

Drag and drop marker issue

I'm building a map where the user can select a marker and drop it on the map, If the user wishes thay can then pick up the marker and move it to a new location. ( drag() n drop() ) then the user may rotate or spin reoientate the marker. Finally the user may record all the marker positions into a XML file. (ok nothing revolutionary here, and sorry for being explicit, but I have problems explaining things.) -- The problem.. when the marker is dropped the X,Y coords are recieved, But when the user moves the marker, the XY don't change, it appears the marker's transformation coordinates change. Evidence after the marker has been drag dropped it still rotates around its original XY dropped position, not around its own axis. // I could easily use remove child then add a new child at the new position, however this plays havoc with the XML structure I'm using. Suggestions please.
VIEWS ON THIS POST

50

Posted on:

Monday 31st December 2012
View Replies!

Multiplayer

adobe has introduced native multiplayer support with the newer versions of the flash player.. i suggest you use that, but there is some kind of hitch.. i think your games can onl ybe 5 minutes at a time.. otherwise you have to start paying all sorts of costs! but a free 5 minute flash game is pretty decent.. you can break it up into different sessions if you want people to keep going further than that
VIEWS ON THIS POST

39

Posted on:

Monday 31st December 2012
View Replies!

Flash Game Race AS 3.0, help me..

i need help. i want to create game for my final project. i use AS 3.0 for language. i need your help, i want create game similar to this: http://www.ipermainan.com/game/6378/boat-rush how road can run the right and left limits from small to big.. like run.. how.. please.. please give me some refrence, or tutorials.. i need your help.
VIEWS ON THIS POST

81

Posted on:

Monday 31st December 2012
View Replies!

Reset "Canvas" View

, I'm currently working on a mapping tool which allows you to navigate around a map, zoom in and out, and then reset the view if required. I'm having some problems with creating the reset view button which works up until you decide to zoom in. I have a feeling it has something to do with the scale of the image changing when you zoom in and the "reset scale" not being variable. The entire code for the project is below (I have separated the "reset" code into a further code box below): Code: Mouse.hide(); stage.addEventListener(MouseEvent.MOUSE_MOVE,follow); function follow(evt:MouseEvent){ moveMapCursor.x = mouseX; moveMapCursor.y = mouseY; } stage.addChild(moveMapCursor); /* ActionScript 3 Effect by Doug Ensley and Barbara Kaskosz. http://www.flashandmath.com/ Last modified: May 26, 2010. */ // Import the MatrixTransformer class import fl.motion.MatrixTransformer; /* Initially hide the zoom in/out cursors. Note that mcIn and mcOut were created on the stage and converted to movieclips using Modify > Convert to Symbol with the registration point set in the center. We converted the header text to a movieclip as well, mcHeader, to make it invisible while the image is loading. */ mcIn.visible = false; mcOut.visible = false; mcCrosshair.visible = false; mcHeader.visible=false; but_reset.visible=false; //We created a dynamic text field, infoBox, to display loading information. infoBox.wordWrap=true; infoBox.mouseEnabled=false; // 'board' provides a background on which the image resides. var board:Sprite=new Sprite(); addChild(board); // We create variables for the width and height of the board so we can scale the picture accordingly. // These settings should be chosen with consideration of the pixel dimensions of the original picture. var boardWidth:int=1024; var boardHeight:int=720; //The position of 'board' will detrmine the position of your picture within the main movie. board.x=0; board.y=75; /* The board will have a background so we can have the whole board listen for mouse events. The "image sprite" created below will be a child of the board. */ board.graphics.beginFill(0xDDDDDD); board.graphics.drawRect(0,0,boardWidth,boardHeight); board.graphics.endFill(); /* spImage is a Sprite on which we will place the image. spImage is a Sprite so we can attach listeners for response to mouse events to implement drag & drop. */ var spImage:Sprite = new Sprite(); board.addChild(spImage); // Create a mask for the spImage with shape identical to the board. // This will keep a scaled or moved picture from "leaving" the designated board area. var boardMask:Shape=new Shape(); boardMask.graphics.beginFill(0xDDDDDD); boardMask.graphics.drawRect(0,0,boardWidth,boardHeight); boardMask.graphics.endFill(); boardMask.x = 0; boardMask.y = 0; board.addChild(boardMask); spImage.mask = boardMask; // scaleFactor for the proportion of scaling corresponding to each 'click' of the mouse wheel. // The value 0.8 reflects 80% scaling when zooming out and 125% scaling when zooming in. var scaleFactor:Number = 0.3; var minScale:Number = 0.25; var maxScale:Number = 2.0; var image:Bitmap; // Declare variable for loading of image from a file. var loader:Loader = new Loader(); loader.contentLoaderInfo.addEventListener(Event.COMPLETE,initPic); loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,updateInfo); infoBox.text="Loading begins"; //Replace Kazanie_Skargi by the name of your image or the address of your image. loader.load(new URLRequest("HMOMap.jpg")); function updateInfo(e:ProgressEvent):void { infoBox.text="Loading: "+String(Math.floor(e.bytesLoaded/1024))+" KB of "+String(Math.floor(e.bytesTotal/1024))+" KB."; } function initPic(e:Event):void { infoBox.text=""; infoBox.visible=false; but_reset.visible=true; mcHeader.visible=true; image=Bitmap(loader.content); minScale = boardWidth/image.width; image.scaleX=minScale; image.scaleY=minScale; // We add the image and the cursor movie clips to spImage. Since spImage is masked, so will its children. spImage.addChild(image); spImage.addChild(mcIn); spImage.addChild(mcOut); spImage.addChild(mcCrosshair); /* We use extremely basic drag and drop functionality. See the "Tour of Drag and Drop" tutorial on the flashandmath.com site for different models that allow for more flexibility. */ spImage.addEventListener(MouseEvent.MOUSE_DOWN, startDragging); stage.addEventListener(MouseEvent.MOUSE_UP, stopDragging); // Clean up listeners & loader now that the load is complete. loader.contentLoaderInfo.removeEventListener(Event.COMPLETE,initPic); loader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS,updateInfo); loader=null; // Drop shadows are always cool board.filters=[ new DropShadowFilter() ]; // A click on the image sprite is handled by the zoom function below. spImage.addEventListener(MouseEvent.CLICK, zoom); } // Event handlers for mouse_down and mouse_up that enable basic drag-and-drop functionality. function startDragging(mev:MouseEvent):void { spImage.startDrag(); } function stopDragging(mev:MouseEvent):void { spImage.stopDrag(); } // Event handler for click event that performs zooming in and out via MatrixTransformer methods. function zoom(mev:MouseEvent):void { // If it is not the case that exactly one of the shift key or ctrl key is depressed, then we do nothing. if ((!mev.shiftKey)&&(!mev.ctrlKey)) { return; } if ((mev.shiftKey)&&(mev.ctrlKey)) { return; } // Declare a variable for the transform matrix of the image object. var mat:Matrix; /* Get the point at the mouse in terms of image coordinates and (its parent) spImage coordinates. These points are aligned when the mouse click happens but after image is scaled, they will not be aligned anymore. */ var externalCenter:Point=new Point(spImage.mouseX,spImage.mouseY); var internalCenter:Point=new Point(image.mouseX,image.mouseY); // We scaled the image up (but bounded by maxScale) or down (bounded by minScale) depending on whether the shift key // or the ctrl key is down while the mouse click happens. if (mev.shiftKey) { image.scaleX = Math.max(scaleFactor*image.scaleX, minScale); image.scaleY = Math.max(scaleFactor*image.scaleY, minScale); } if (mev.ctrlKey) { image.scaleX = Math.min(1/scaleFactor*image.scaleX, maxScale); image.scaleY = Math.min(1/scaleFactor*image.scaleY, maxScale); } /* The mat matrix is the transformation matrix for the scaled version of image; i.e., the version that no longer has internalCenter and external center aligned. */ mat = image.transform.matrix.clone(); /* The matchInternalPointWithExternal method of the MatrixTransformer class changes the mat matrix to include a translation that makes the point in terms of image coordinates line up with the point in terms of spImage coordinates. */ MatrixTransformer.matchInternalPointWithExternal(mat,internalCenter,externalCenter); // Now applying the mat matrix to the enlarged image will align the internalCenter to the externalCenter. image.transform.matrix=mat; } // We use the ctrl and shift keys to display the two different cursors that were created on the stage. stage.addEventListener(KeyboardEvent.KEY_DOWN, keyHandler); stage.addEventListener(KeyboardEvent.KEY_UP, keyHandler); function keyHandler(ke:KeyboardEvent):void { // No matter what key is pressed or released we move the cursor movie clips to the mouse position. mcIn.x = spImage.mouseX; mcIn.y = spImage.mouseY; mcOut.x = spImage.mouseX; mcOut.y = spImage.mouseY; // The visible cursor will correctly correspond to a depressed key. mcIn.visible = ke.ctrlKey; mcOut.visible = ke.shiftKey; // If either key (ctrl or shift) is depressed, we hide the mouse. if (ke.ctrlKey || ke.shiftKey) { Mouse.hide(); moveMapCursor.visible=false; } else { moveMapCursor.visible=true; } } And here is the reset button code on it's own for ease of reading/debug: Code: //Reset button activation so that view is restored but_reset.addEventListener(MouseEvent.CLICK, resetMap); function resetMap(e:MouseEvent):void { spImage.x = 0; spImage.y = 0; spImage.scaleX = spImage.scaleY = 1; } The code is made up of the board which contains the spImage container. The spImage has the image and controls in it. The idea of changing the scale of the spImage rather than the image itself is because it seems to stretch the image, messing up the resolution so I felt the easiest way would be to adjust the scale of spImage. So, as stated earlier the main problem is that the reset breaks when you zoom in or out, but works perfectly otherwise, snapping to the top of spImage if the image itself has been dragged around. Maybe there is a way of setting a state and reverting back to this later If anyone can help me at all I would be very grateful. Cheers, KugarWeb
VIEWS ON THIS POST

46

Posted on:

Monday 31st December 2012
View Replies!

Flash Function...errr help please with get in Actionscript3

I have this setup on 2 classes where I am trying to get an array of Data back from a function call in class A. Could anyone help me with this please best regards FJW package { public class A { private var thefront:TheFront; private var theData:Array; public function A() { } public function needData():void { thefront = new TheFront(); theFront.test(); } } package { public class TheFront { private var bArray:Array; public function TheFront() { trace("TheFront called"); bArray = new Array("A","B","C","D","E","F"); } public function set test():Array { trace("Testcalled"); return (bArray); } }//End Cons }//End Package
VIEWS ON THIS POST

51

Posted on:

Monday 31st December 2012
View Replies!

Get row/col from index/size.

I'm working on some row/col functions for converting back and forth... Is there a simpler way to do this second function Btw, these appear to be working correctly, but I am not 100% sure they are completely correct. I'm converting back and forth between rows/cols and index/sizes. The tables are square. The math is done to match flash array's and vectors which start at index 0. public static function getTileIndexByRowCol(Col:int,Row:int,mapSize:int): int { var Index:int = Row * mapSize + Col; return Index; } public static function getRowColByTileIndex(Index:int,mapSize:int):Object { var rowCol:Object = new Object(); if (Index > 0) { var Num:Number = Index / mapSize; var Rem:Number = Number("." + String(Num).split(".")[1]); if (isNaN(Rem)) { Rem = 0; } rowCol.Row = Math.floor(Num); rowCol.Col = Math.round(Rem * mapSize); } else { rowCol.Row = 0; rowCol.Col = 0; } return rowCol; }
VIEWS ON THIS POST

51

Posted on:

Monday 31st December 2012
View Replies!

Flash Does ASC 2.0 support tail call optimization?

Does the ActionScript Compiler v2.0 support tail call optimization The features list at bytearray.org says: Reduces function overhead by removing unnecessary activation records.
VIEWS ON THIS POST

74

Posted on:

Monday 31st December 2012
View Replies!

Flash Get external file closed

, I have one flash EXE. If there is no activity to a fixed time, it starts a flash screensaver (swf studio screensaver). Now i want to know in the main exe when the screensaver is closed. One method is to add a 1 second timer in main exe, which will watch running processes. If it not find the screensaver in running processes then it will reset its variables. But i dont want to run the 1 sec timer. Is there any other way to get that the screensaver or some other exe is closed now
VIEWS ON THIS POST

61

Posted on:

Monday 31st December 2012
View Replies!

sound from flvPlayback won't stop

I have a website http://www.droolpigs.com when I go there if I click the video archives button then play a video then click on the home or photos button or one of the alternate background buttons on the left the video goes away as it should but not always the audio (especially when I click while the video is still buffering). Is there a command I can use to kill the sound from the flvPlayback component and nothing else(I have a mp3 player there also I so I don't want to use the SoundMatrix class. btw the videos are all played on an instance of the flvPlayback component.
VIEWS ON THIS POST

65

Posted on:

Monday 31st December 2012
View Replies!

Flash Flash/XML Slideshow - Back button

If anyone can help me with this I think I would kiss your feet. I have been fighting with this for the past several days and I still cant figure it out. I just need to make the back button function that I have created from the tutorial that I found online. I have the link below to the exact tutorial I am referring to, as well as a text document of the code. If anyone could please help me with the I would be extremely grateful. Also I should mention that the code inside the function loadImagePrevious() makes no sense, thats in part due to me just throwing code in there to see what happens. The farthest I ever got it to go was saying that it was loading the image. Grant it I dont know if that is the next or previous image that is was loading. http://active.tutsplus.com/tutorials...slideshow-xml/
VIEWS ON THIS POST

52

Posted on:

Monday 31st December 2012
View Replies!

Access Overriden Class of Child Domain

I've been working with loaded swfs whose application domain is a child of the loader's current domain. Code: var appDom:ApplicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain); Now in Senocular's fantastic article on Application Domain, it states, "Child domain definitions, even if being overridden by the parent domain can still be accessed from the application domain directly through getDefinition which is covered in the Getting Definitions Dynamically section." I've read all through that article and any other information I could find on the application domain, and while I have been able to access the child domain's classes, I have not been able to access the overridden classes. Code: myLoader.contentLoaderInfo.applicationDomain.getDefinition("MyClassName"); The above code does get the child classes, but for overridden classes it gets the parent domain's classes. So how can I get access to those overridden child classes Or is the article and Adobe documentation mistaken and the overridden child classes are not retained
VIEWS ON THIS POST

37

Posted on:

Monday 31st December 2012
View Replies!

The supplied DisplayObject must be a child of the caller.

What does it mean And why doesnt my code work PHP Code: stop();importflash.events.Event;varTimerApple:Timer=newTimer(500);TimerApple.addEventListener(TimerEvent.TIMER,OnStartApple);TimerApple.start();functionOnStartApple(e:Event){\t\tvaraf:Sprite=newEnemy();\t\taf.x=Math.random()*640;\t\taddChild(af);\t\t\t\t//Removefromstage,willgivepoint\t\taf.addEventListener(Event.ENTER_FRAME,hitTheGround)\t\tfunctionhitTheGround(e:Event):void\t\t\t\t{\t\t\t\t\t\tif(af.hitTestObject(Basket)){\t\t\t\t\t\tremoveChild(af);\t\t\t\t\t\t}\t\t\t\t}\t\t\t\t//Controllingbasket\t\t\t\tBasket.addEventListener(MouseEvent.MOUSE_DOWN,fl_ClickToDrag_2);\t\t\t\tfunctionfl_ClickToDrag_2(event:MouseEvent):void\t\t\t\t{\t\t\t\tBasket.startDrag();\t\t\t\t}\t\t\t\t} And then the class "Enemy" PHP Code: package{\t\timportflash.events.Event;\t\timportflash.display.MovieClip;\t\timportflash.display.Sprite;\t\timportflash.text.TextField;\t\tpublicclassAppleextendsSprite{\t\t\t\tprivatevarcore:Object;\t\t\t\tpublicfunctionApple(){\t\t\t\t\t\taddEventListener(Event.ADDED_TO_STAGE,onadd);\t\t\t\t}\t\t\t\t\t\t\t\tprivatefunctiononadd(e:Event){\t\t\t\t\t\tcore=MovieClip(root);\t\t\t\t\t\taddEventListener(Event.ENTER_FRAME,loop);\t\t\t\t}\t\t\t\t\t\t\t\tprivatefunctionloop(e:Event){\t\t\t\t\t\ty+=10;\t\t\t\t\t\t}\t\t\t\tpublicfunctionremoveListeners():void{\t\t\t\t\t\tremoveEventListener(Event.ENTER_FRAME,loop);\t\t\t\t}\t\t}}
VIEWS ON THIS POST

41

Posted on:

Monday 31st December 2012
View Replies!

Little help finding closest isometric tile to point...

I am using this tutorial right here... And trying to get it to work with my bottom function below. Getting a bit lost... This tutorial has a example FLA but it's like AS2 or something and confuses the hell out of me. Going to get some sleep and give it another attempt tomorrow. http://www.tonypa.pri.ee/tbw/tut18.html //Tile placing code... public static function colRowToPoint(Col:int, Row:int, tileSizeX:int, tileSizeY:int)oint { var xyPoint = new Point(); xyPoint.x = (Col - Row) * ((tileSizeX / 2) + 1); xyPoint.y = (Col + Row) * (tileSizeY / 2); return xyPoint; } //This function still needs work, not working yet... public static function getClosestCell(Targetoint, tileSizeX:int, tileSizeY:int, mapSize:int):Object { var tileDistX = ((tileSizeX / 2) + 1); var tileDistY = (tileSizeY / 2); var rowCol:Object = new Object(); rowCol.Row = Math.round((Target.x - Target.y) / tileDistX); rowCol.Col = Math.round(((Target.x + Target.y) / 2) / tileDistY); return rowCol; } Edit: Getting warmer... I think I almost solved it...
VIEWS ON THIS POST

95

Posted on:

Monday 31st December 2012
View Replies!

Flash problems with xml

I'm in trouble with xml because it has 300 mb. When vai load takes too long. I waited a few minutes but gave up after 20 minutes please help me out Note with the same xml but with fewer items will not be long open normal
VIEWS ON THIS POST

45

Posted on:

Monday 31st December 2012
View Replies!

Please review how I want to do masking

I can't try this at the moment, but I would like to know if this is the way to do it. So here is the scenario: I am developing a standalone app that is composed of modules. A module is a sprite container that contains other sprites or movieclips. Pure AS3, design was made with the IDE and exported as SWF. In one module, I have a curved background that is loaded from an SWF. On this curved background I have other modules loaded that are displayed with an alpha tween and they are fully on the background, they don't move. But I have two modules that have a rectangle base bigger than the height of the curved background and I want to motion tween them on the curved background in a way that the parts hanging off the curved background are masked. So the Z order and hierarchy would be like this: ------ sprite container parent curved backgroundmodule 1 (staying inside background)module 2 (inside)module ... (inside)bigger rectangle module that need to be masked and motion tweened inMy solution would be: load another instance of the curved background to use it as a mask.add this mask to the display list as a child of the "sprite container parent"keep this mask on the top of all modules(\t not sure about this)position the mask exactly as the curved backgroundload the module that I want to mask and position it outside of the visible stageadd the mask on the module that need to be masked.motion tween the module to the visible areaWhat I am not sure about: even if the mask is not child the module to be masked, will it move with the module that is tweened (I want the mask to stay still)I want every other display object to be visible under the mask, only the masked module should be masked (this is obvious I guess
VIEWS ON THIS POST

43

Posted on:

Thursday 3rd January 2013
View Replies!

Moodle 2.0 and externalInterface call

, I am having a problem with an externalInterface call from a SWF to a javascript function. i am on a new Moodle 2.0 LMS which I am not too familiar with yet. Any help would be greatly appreciated. Code: function reenableMainConsole():void { txtErrors.text = "In reenableMainConsole function. \n"; if (ExternalInterface.available) { txtErrors.text += "In extInterface. \n"; try { ExternalInterface.addCallback("sidetrackStop", receivedFromJavaScript); if (checkJavaScriptReady()) { txtErrors.text += "JavaScript is ready.\n "; } else { txtErrors.text += "JavaScript is not ready.\n"; } } catch (error:SecurityError) { txtErrors.text += "A SecurityError occurred: " + error.message + "\n"; } catch (error:Error) { txtErrors.text += "An Error occurred: " + error.message + "\n"; } function receivedFromJavaScript(value:String):void { txtErrors.text += "JavaScript says: " + value + "\n"; } function checkJavaScriptReady():Boolean { var isReady:Boolean=ExternalInterface.call("isReady"); txtErrors.text += "isReady: " + isReady; return isReady; } } else { txtErrors.text += "Not in extInterface."; } }
VIEWS ON THIS POST

71

Posted on:

Thursday 3rd January 2013
View Replies!

Error 1120 in Flash CS5.5

Can anyone please tell me how to correct this error in the Adobe Flash CS5.5,Air for IOS . This app was built for the iPhone. My setting are; Player:AIR for IOS Script:ActionScript3.0 Profile:Default:Publish Setting An error code 1120 was reported during the debug test run . This is the procedure I used to build and run the program. 1.Constructed a 6 frames comic strip each was set at 290 pixels wide by 390 pixels high and layer them into one strip 1980 pixels wide by 390 pixels high and saved as a png file with the Gimp.org program. 2.I open Flash CS5.5 and selected Air for IOS set the align center with text tool. 3.The stage was at 320 by 480 at 40 FPS. 4.Imported in the comic strip on to the stage and set the x15 and the y50 for the first frame of the comic strip within the stage and saved it as a .fla file in the sames location as the Flash CS5.5 file. The comic strip was located in Layer 1 on the Timeline.No additional layers were use. 5.I did the example coding and the only area I changed was the number of frames .I was going to change the tiles.x -=33 to 29 and not change the, if(slideCounter == 10) because my frames are 290 pixels wide but I decided not to change anything except the title to the program I was creating and saved as a .as file in the same location as the .fla file. 6.In the fla setting on the stage I selected Control tool ,Test Movie,in Air Debug Launcher (Mobile) than an error code was reported; #1120:Access of undefined property tiles was repeated 4 times and than the same error code but this time Access of undefined property slideCounter. This occurred at line; tiles.addEventListener("enterFrame",movieTilesRigh t); and at line;if(slideCounter ==10). I have been searching the error code on the Internet. Could you please explain on how I can correct these errors. Here is this simple swipe-multi touch-Gesture code;    package { import flash.display.MovieClip; import flash.ui.Multitouch; import flash.ui.MultitouchInputMode; import flash.events.TransformGestureEvent; import flash.events.Event; public class TwinJustice extends MovieClip { private var currentTile:Number = 1; private var totalTiles:Number = 6; private var slideCount:Number = 0; public function TwinJustice() { if(Multitouch.supportsGestureEvents) { init(); } else { trace("what you talkin* bout gestures"); } } private function init():void { Multitouch.inputMode = MultitouchInputMode.GESTURE; this.stage.addEventListener(TransformGestureEvent. GESTURE_SWIPE, handleSwipe); } private function handleSwipe(event:TransformGestureEvent):void { if(event.offsetX == 1) { if(currentTile > 1) { slideRight(); currentTile--; } }else if(event.offsetX == -1) { if(currentTile < totalTiles) { slideLeft(); currentTile++; } } } private function slideLeft():void { tiles.addEventListener("enterFrame" , moveTilesLeft); } private function slideRight():void { tiles.addEventListener("enterFrame" , moveTilesRight); } private function moveTilesLeft(event:Event):void { tiles.x -=33; slideCounter++; if(slideCounter == 10) { tiles.removeEventListener("enterFrame" , moveTilesLeft); slideCounter = 0; } } private function moveTilesRight(event:Event):void { tiles.x += 33; slideCounter++; if(slideCounter == 10) { tiles.removeEventListener("enterFrame" , moveTilesRight); slideCounter = 0; } } } } Where did I go wrong Any information would be greatly appreciated. Thank You,  
VIEWS ON THIS POST

97

Posted on:

Thursday 3rd January 2013
View Replies!

custom event not receiving (again)

This has literally been buggin me for days. I cant get my custom event "selectionEvent" to work. It works in the DocumentClass constructor, but when trying to dispatch from a child object it doesnt recieve!!!! also in my other thread about custom events, If I try to add the listener to the child object, it just says "undefined property loadplayscreen". DocumentClass: (dispatches fine here) EDIT: updated (little change) Code: package { import flash.display.MovieClip; import flash.events.Event; public class DocumentClass extends MovieClip { //New Constructor public var fighter:Fighter = new Fighter; public var playscreen:FightingGame; public var platform:Platform = new Platform; public var selectionScreen:SelectionScreen; public var selectedCharacter:int; public function DocumentClass() { addEventListener(Event.ADDED_TO_STAGE, FightingGameBuild, false, 0, true); addEventListener(SelectionEvent.PLAYSCREEN,loadPlayScreen); } //Old Constructor public function FightingGameBuild(event:Event):void { removeEventListener(Event.ADDED_TO_STAGE, FightingGameBuild); trace("new constructor"); selectionScreen = new SelectionScreen; playscreen = new FightingGame; selectionScreen.addEventListener(SelectionEvent.PLAYSCREEN,loadPlayScreen); loadSelectionScreen(); } public function loadPlayScreen(e:SelectionEvent):void { if (playscreen) { trace("loaded"); removeChild(selectionScreen); playscreen = new FightingGame; addChild(playscreen); } else { trace("failed"); } } public function loadSelectionScreen(selectionevent:SelectionEvent):void { if (selectionScreen) { trace("selection Screen"); addChild(selectionScreen); selectionScreen.x = 260; selectionScreen.y = 250; } else { trace("failed"); } } } } Here is the SelectionScreen Class: Code: package { import flash.display.MovieClip; public class SelectionScreen extends MovieClip { public var selectedCharacter:int; public var selectarrow:SelectArrow = new SelectArrow; public function SelectionScreen() { trace(selectedCharacter); addChild(selectarrow); selectarrow.x = 300; selectarrow.y = 300; } } } The selectArrow Class (which is dispatching the event) Code: package { import flash.display.MovieClip; import flash.events.MouseEvent; public class SelectArrow extends MovieClip { public function SelectArrow() { this.addEventListener(MouseEvent.CLICK,clickbox); } public function clickbox(e:MouseEvent):void { dispatchEvent(new SelectionEvent(SelectionEvent.PLAYSCREEN)); trace("clicked"); } } } And finally the SelectionBox class ( I dont know if this one is important.) Code: package { import flash.display.MovieClip; import flash.events.MouseEvent; import flash.utils.Timer; import flash.events.TimerEvent; import flash.events.Event; { public class _select_StickMan extends MovieClip { public var playscreen:FightingGame; public var selectedCharacter:int; public var selectionscreen:SelectionScreen; public function _select_StickMan() { for(var i:int=0;i
VIEWS ON THIS POST

39

Posted on:

Thursday 3rd January 2013
View Replies!

Remote flash call

, I'm using flash aplication to generate (in real time) complecated Bitmap / BitmapData, and then I would like to give result to web user. How to run this process without putting whole application to swf file (which can be decompiled) over the internet, but giving to user only result image How to make flash aplication server-side Can it be done using only adobe technology
VIEWS ON THIS POST

39

Posted on:

Thursday 3rd January 2013
View Replies!

Flash listener to wait for an instance?

I am wasting a lot of time trying to understand why I am instantiating an object that doesn't want to be instantiated! I explain: I have this code in the main class Code: ... centralButton = menu_mc.automaticCentral_mc; trace ("central button is "+centralButton); trace("main"); ringTimerObj = new RingTimer(lastingCountDown); ringTimerObj.addEventListener(Event.ADDED, initRingTimer); trace("main2"); ... Code: private function initRingTimer(e:Event) { ringTimerObj.removeEventListener(Event.ADDED, initRingTimer); ringTimerObj.initRingTimer(); } while in the RingTimer class I have Code: public function RingTimer(_betSeconds : uint) // constructor { betSeconds = _betSeconds; ringTimer = new Timer(1000, 0); ringTimer.addEventListener(TimerEvent.TIMER, updateCountDown, false, 0, true); } public function initRingTimer() { trace("ciao"); trace("parent = "+this.parent); rouletteMenu = (this.parent as MovieClip).centralButton; trace("ciao2"); } I do not receive any kind of error, but the trace is Code: central button is [object automaticCentral_mc_153] main main2 "ciao" and "ciao2" are absent. At first I didn't use the listener, it was obvious for me that the instantiation of RingTimer didn't need it, but I received the trace Code: central button is [object automaticCentral_mc_153] main ciao parent = null TypeError: Error #1009: Cannot access a property or method of a null object reference. at RingTimer/initRingTimer() at Main/initRingTimer() at Main/postConfigLoad() at Main/xmlConfigLoaded() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at flash.net::URLLoader/onComplete() as if RingTimerObj hasn't still been instantiated. What's happening! It looks like I need to wait an event to proceed with initRingTimer, but... am I using the wrong event Do I really need an event Am I doing something wrong
VIEWS ON THIS POST

51

Posted on:

Thursday 3rd January 2013
View Replies!