actionscript-3

I'm trying to pass an instance of one class into another. Having difficulties.

So I'm dealing with two classes at the moment, a Laser class, (which corresponds to a movieclip) and an Enemy class. The enemy class is linked to multiple enemy movieclips. When it's created, it will look for collisions with an instantiation of the laser class. Here is where I'm having trouble. I want to work things out so that when the ...

AS3 URLRequest stored in array needs now to load, how?

Hey guys, I have a bit of code here that pulls, at random, 50 images from a file and pushes them into an array. I now need to pull, at random, 350 times from the array. I'm using a timer in place of the for loop to grab the images from the array. My code works fine as long as I do not use an array and I loop the images straight from t...

unable to get HTTP response code/headers in actionscript 3?

I'm using URLLoader to POST to a server. The xml response from the server can respond with a 404 or a 403 (forbidden) error. However I am unable to get the response codes. Here is the code var urlString:String = "some url"; var urlRequest:URLRequest = new URLRequest(urlString); var loader:URLLoader = new URLLoader(); loader.a...

What is the difference between obj[name] and obj.name in ActionScript?

I have heard different things in forums but unable to find a concrete answer on the difference between obj[name] and obj.name. Does the compiler treat them differently? ...

accessing child movieClips FlashDevelop

I have a movieClip within another MovieClip. I gave the child movieClip the instance name "hSprite" and I added it to the parent movieClip stage. Now I get an error like the following. [Fault] exception, information=ReferenceError: Error #1056: Cannot create property hSprite on com.objects.Hero. If I remove the instance name from the ...

Render each frame as a single image

Just curious, can flash take each frame and export it out as a image ? In my case, I want to create sprite images for a flashdevelop project using blitting. Of course I know there is a solution for this. like copy and paste each shape into a image editor such as photoshop and turn them into png's. But I am just seeing if there is a simpl...

Check for whole number in AS 3

How can I check for a whole number in AS 3? Example: for (var i:int = 0; i < thumbs.length(); i++) { if((i / this.thumbsRow) === wholeNumber) } ...

Playing with Graphics in Flex

Hi All, I was just going through one code used to draw one chart. This code is written in the updateDisplayList of the itemrenderer of column chart. I am not good at the graphics part of flex. Can anybody please explain me what this code is doing. I can see the final output, but am not sure how is this achieved. var rc:Rectangle = new ...

Flash: MovieClip width and scale proble from ActionScript3

Hi, I am new to ActionScripot and Flash and I am stuck with the following problem: On the stage I have a movieclip (Container, originally 200px width) and inside it with a progressbar movieclip (originally 700px width), scaled with Free Transform Tool to fit the parent container. The width of the container changes run-time while resizin...

Returning a variable from an ExternalInterface.call() back into Flash

I'm calling a JS function with ExternalInterface.call and trying to get a return value inside Flash. When I trace out the op variable I get 0 instead of 500. Is there something wrong with my embed code? Embed code: <embed src="/sites/default/files/flash/flashgame/Preload.swf" width="975" height="572" align="middle" FlashVars="entry=log...

combine mutiple movie clip functions into a single swc file or MXP file For Flash Action Script 3.0?

hi, I have to build one MXP package for Flash (not Flex). But i have multiple components, somthing like HelpSymbolMovieClips(have its on class), one image holder. etc. I need to combine there swc file into a single MXP file. Is it possible? or How can i make a all these multi movieClip functionality in a single SWC file. Am bit confu...

Actionscript 3 - Reference vs. Value

I thought I had references in AS3 figured out, but the following behavior puzzles me: // declarations for named individual reference later on var myAmbientSound:Sound; var myAmbientSoundLocation:String = "http://ambient_sound_location"; var myPeriodicSound:Sound; var myPeriodicSoundLocation:String = "http://periodic_sound_location"; v...

Error #1010 actionscript 3

The counter displays sprites in place of number values. More experienced programmers have given me a clue. Why am I getting error # 1010. Secondly, what am I not seeing that's so obvious? I wish I went in to this with a better foundation in actionscript 3, but I'm reading and doing my best. WHAT I SEE -dollar sign indicates a variabl...

actionscript-3: check if movieClip exists

I have a movieclip created with the following code: var thumbContainer:MovieClip = new MovieClip(); thumbContainer.name = "thumbContainer"; stage.addChild (thumbContainer); If the window gets larger/smaller I want everything back in place. So I have an stage Event Listener. Now I want to see if this mc exists to put back in place. I'v...

How do I dynamically instantiate a class, and set a property at runtime in Flex 3?

Using org.as3commons.reflect I can look-up the class name, and instantiate a class at runtime. I also have (non-working) code which invokes a method. However, I really want to set a property value. I'm not sure if properties are realized as methods internally in Flex. I have a Metadata class which stores 3 pieces of information: name,...

Flex XMLListCollection Iteration Concatenating Collected Values...

I am working in flex builder 3 with an XMLListCollection and have run into this (should be simple) parsing snag... The XMLListCollection Data: <data> <term name="NUMBERS"> <alt_form name="1"/> </term> <term name="LETTERS"> <alt_form name="A"/> <alt_form name="B"/> <alt_form name="C"/> </t...

Simple syntax question

Hey everyone, First off, sorry for my noob-ness. Believe me when i say ive been rtfm'ing. Im not lazy, im just dumb (apparently). On the bright side, this could earn someone some easy points here. I'm trying to do a match/replace with a pattern that contains special characters, and running into syntax errors in a Flex 3 app. I just wan...

Can you iterate over chunks() with request.POST in Django?

I'm trying to optimize a site I'm building with Django/Flash and am having a problem using Django's iterate over chunks() feature. I'm sending an image from Flash to Django using request.POST data rather than through a form (using request.FILES). The problem I foresee is that if there is large user volume, I could potentially kill memory...

What are some good Flash game frameworks?

Pretty straightforward. Open source is good, but organization and documentation is better. Actionscript 3 is a must, I don't really want to start working with the older versions. I guess that's the crux of my problem using Google, because there are vast quantities of how to do thing "the old way" out there, but I'm having trouble getting...

Programatically Rewinding Movie Clip Removes Gradient Mask (FlashCS4/AS3)

i'm trying to created a auto-rewind movie using a gradient mask in Flash CS4 using AS3. the only problem i'm having is when the movie clip reaches the end of the time line, the maskingLayerMC looses it's gradient. so while the movie rewinds, the maskingLayer has no gradient. it regains it's gradient when the playhead reaches the first...