actionscript-3

How Do I See All Events Fired by an Object?

I am having trouble wiring up an event listener to a fl.transitions.Transition. Is it possible to somehow view all the events an object fires? That way I could check I am using the correct event (and possible view better ones to use). ...

To add or not to add a child? with Flash

Hi all, I am facing a situation that I have problem understanding... I am writing a little Drag and Drop game that comes with its own solution. Game starts on frame 1, solution of frame 150. To show the solution, I chose to display all drag items in their original position and fade them out one by one while concurrently fading in anot...

Regular expression for a specific pair or each item in a pair

I have a situation where I might be getting one or both of a pair of characters and I want to match either. For example: str = 'cddd a dfsdf b sdfg ab uyeroi' I want to match any "a" or "b" or "ab". If the "ab" comes together I want to catch it as a single match (not as two matches "a" "b"). If I get "ab" it will always be in that or...

splice Object into nested Array code error

I am trying to replace an Object inside my nested array (colArray) by using splice, the object acts as my player and will need to maneuver around the Array it's in. The Problem is splice doesn't appear to be showing anything in return, it comes up with an error saying: Cannot access a property or method of a null object reference. Wha...

Flex library projects: `undefined` is "unknown or not a compile-time constant"?

I'm in the process of refactoring a Flex application into a "library project", and one of the, err, interesting errors I've come across involves a function like this: function spam(eggs:*=undefined):void { ... } While it was a "Flex application", this function compiled without issue… But when I try to build it as a "library projec...

Several second computation in a game while maintaining 60 FPS

I've got an algorithm that takes more than several seconds to complete. I'm trying to implement it into a 60fps flash game i'm creating. I am wondering if there is some provision in ActionScript3 to interrupt a computation in order to update the frame and continue the computation afterwards. There probably isn't, so I'm assuming the best...

Action Script Set Focus

Hi Guys, I have a KeyboardEvent.KEY_DOWN event listener on frame 10 and on the first frame a button which when clicked takes you to frame 10, if you add gotoAndPlay(10); on the top of frame 1 the event listener works fine, if you click the button to get to frame 10 you have to click somewhere in the frame before the event listener works...

File Upload from FLEX or ActionScript 3 to ASPX .NET??

Hello. I would like to know how to upload a file from ActionScript 3 (From a FLEX Application) to a Dot Net Back End, maybe to an ASHX file, an ASPX file or similar and using C# as core backend language. Thanks!! ...

Is there a way to force PDFs to open in Adobe Reader rather than in plugins?

Hi, We have an Air and Flash application that opens a pdf, but many computers by default open pdfs in browser plugins rather than through reader itself. Is there a way to force the alternate behavior in Flash/Air? This is needed since we have slightly writable pdfs. Thanks! ...

How do I change hexidecimal colours programmatically to get lighter or darker?

I want to have a base colour, say 0x0066FF and I want every iteration after that to get slightly darker for example. ...

Object tracking/detection in Flash video

Hi there, I am wondering if there's any way I can track objects in Flash video using ActionScript? For example, let's say I would like to track a red ball, how can I do this? I have seen some examples using the OpenCV port but the examples shown are for face detection. And I can't seem to figure out what's the difference between the Op...

Can Action Script FileReference object be sent to Javascript and converted to File object ?

In Action Script, FileReference.browse() is called. I would like to send the chosen file to Javascript and convert it to File object, just like if I would press the Browse button of the <input type='file /> and got File object. I need that to be able to display picture thumbnail like shown here. Maybe instead of passing the whole obje...

Gradient masking flash

i want to put gradient masking effect in my 20 images. var arr:Array = ["m1.jpg","m2.jpg","m3.jpg","m4.jpg","m5.jpg"]; for(var i=0; i<20; i++){ duplicateMovieClip(ho, "newImg_mc"+i , this.getNextHighestDepth()); if(i < 5){ this["newImg_mc"+i]._x = 0; this["newImg_mc"+i]._y = 110*i; this["newImg_mc"+i].loadMovie(arr[i]); } if(i >...

Flex Library Project: NativeMenu vs. ContextMenu

I have a Flex Library Project which has both Flex specific classes, and Air specific classes. When I reference the library in an Air project, the compiler complains about an overriding contextMenu in mx.containers.Panel, saying that the param should be of type NativeMenu (instead of ContextMenu). If I switch it over to NativeMenu then ...

How to use a preloader FlashIDE with FlashDevelop

Hey there ! I'm trying to use a preloader made under FlashIDE (animation, code & stuff) with my project made in FlashDevelop. How can I do that ? Thx ! ...

Problem with AS3 codes

The compiler produces error code "1120: Access of undefined property master_mc." (bolded) Anyone know what went wrong? I followed a tutorial but there wasn't any explanation on how master_mc really works. Please help make this script run properly. Here's the link to the tutorial I tried. var xmlRequest:URLRequest = new URLR...

How to Get the Current Page's URL into Flash

Is it possible to get page URL into flash ? Without using ExternalInteface.call('window.location') trace(this.loaderInfo.url) simply return URL from where flash was loaded. Thank you. ...

Flex/AS3: changing width/height doesn't affect contents

I thought I had a handle on AS3, DisplayObjectContainers, etc. but this basic thing is really confusing me: changing the width/height of a sprite does not affect it's visual contents - either graphics drawn within it or any children it may have. I have searched around and found an Adobe page that represents my own little test code. From...

[ as3 - garbage collecting ] delete a movieclip forever

hello! im just trying to delete forever a mc. i create a mc and then i make an addChild of a sprite. var mcSwap1:MovieClip = new MovieClip(); addChild(mcSwap1); mcSwap1.addChild(mySprite); if i want to delete from everywhere and forever mcSwap1, what can i do? removeChild(mcSwap1); mcSwap1=null; doesn't work very well...the memory ...

Forcing smaller redraw regions in actionscript.

I've got a small action-script chart, that's meant to be live updating, and also be able to support more than 10000 points of data. The way it's currently set up it doesn't need to redraw the whole chart if the new line we wish to add doesn't extend that chart's boundaries. Yet it does, the redraw regions show the whole chart as being...