actionscript-3

ActionScript Local X And Y Coordinates Of Display Object?

i'm trying to trace the x and y coordinates from within a sprite. i've added a rectangle to the stage: var rect:Rectangle = new Rectangle(10, 10, 200, 200); addChild(rect); rect.x = rect.y = 100; adding a Mouse_Move event to the rect, i can trace mouseX and mouseY to receive the coordinates of the stage while moving over the rect, bu...

Check if clicked element is inside of IVisualElement (parent)

Hi, I'm trying to check if a clicked element is inside of an IVisualElement in Flex 4. So I want something like "if this element is in this element, then execute function". I'm aware of the 'parent' property but this doesn't seem to work when my element is not a direct child of the element but for example 3 levels deep. Can anyone he...

Action script 3 bitmap glitch, alpha fade in out

I have actually solved this problem but it was a weird one so I will post it and my solution. I had a movie clip with several children each of which had it's own alpha settings. It also had a bitmap child object with a masked movie clip sitting on top of it. I was fading in and out the parent movie clip and was getting some odd results...

Creating a function within a loop (pointers?)

Im trying to create a simple loop that creates 50 buttons, adds them to screen and then when a button is pressed, it traces out that number. I can get it to work by doing stuff I consider hacky (such as using the buttons X/Y location to determine its value), but I'd rather just be able to hold a single value in the function. The code it...

AS3 FLVPlayback and problems with SMIL files from Highwinds CDN

Here is the src of my SMIL file (with potentially sensitive data XXXX'd out): <smil> <head> <meta base="rtmp://fms004.dc1.hwcdn.net/XXXXXXXX/_definst_"/> </head> <body> <video src="mp4:fms/myvids/EBCVids/onemin/1.mov?doppl=XXXXXXXXXXXXXXXX </body> </smil> I've verified that the smil file is accessible on the CDN serv...

Adobe Flash player Secuirty Pop-Up question

I am building a Audio Recording tool using Flash and Wowza. I dont want to start the recording until the use clicks the Allow Button is the Security Pop-up question represented here http://www.macromedia.com/support/documentation/en/flashplayer/help/help05.html In Audio I dont get this until I attach the stream to it. In Video can get ...

Generating Source Info For Flex BitmapData.

Instead of populating the BitmapData class from an IMAGE. I would like to (within Actionscript) GENERATE some new BitmapData by capturing the Bitmap representing say, a TextArea component on the stage. In other words, sort of take a "screen capture" or "screenshot" of one of the components, and convert that into an image. Am I silly t...

Object Oriented Programming in AS3

I'm building a game in as3 that has balls moving and bouncing off the walls. When the user clicks an explosion appears and any ball that hits that explosion explodes too. Any ball that then hits that explosion explodes and so on. My question is what would be the best class structure for the balls. I have a level system to control levels...

How to turn Bytes into number (IEEE754 to number) Actionscript

How to write such C# code in Actionscript? Console.WriteLine(BitConverter.ToDouble(new byte[8] { 0x77, 0xBE, 0x9F, 0x1A, 0x2F, 0x0D, 0x4F, 0x40 }, 0)); ...

get opposite radian angle - AS3

hi there, I am trying to retrieve the opposite radian angle after I have retrieve a radian angle from another calculation. This is using AS3 ...

AS3 get closest date to today

Hi, I have a XML file with a few concert dates. In my flash/AS3 file, I would like to show only the up coming event, relative to current date. Like this: Event 01: 30-05-2010 Event 02: 02-06-2010 Event 03: 05-06-2010 Today is 28-05-2010, so I need to list Event 01. On 01-06-2010 I need to list Event 02. I have the basic AS3 code f...

AS3 Crossdomain imageload

Hi, Actually i have to load images into stage from any server, so tried using crossdomain.xml from my server root. though it throughs error SecurityError: Error #2122: Security sandbox violation: Loader.content: http://sss/Player.swf cannot access http://ffff/images/logo-bg.jpg. A policy file is required, but the checkPolicyFile fla...

Actionscript 3.0 - drag and throw with easing

I'm creating a map in flash and I would like to have a smooth movement similar to this: http://www.conceptm.nl/ I have made a start but I'm having trouble taking it to the next stage. My code currently throws the movieclip after the mouse is release but there is no easing while the mouse button is down. Any tips on how I would achieve...

AS3 Erease Pixels from Bmp

I Have two bitmaps, one is the orginal and the second is the brush and i want to erease the shape bmp2 from the bmp1. ...

Monitoring file upload progress in Actionscript 3

I'm trying to track the progress of a file upload in AS3, and I'm getting strange behavior. When I select a file and upload it, the progress is instantaneously 100% even if the file is 10 or more megabytes, but it's not finished. The onComplete event is fired about 30 second to a few minutes later (depending on file size) when the file h...

Structuring System Architecture in a Flex Web Application on a Budget (w/o Java)

I started a project a while back using the following architecture from Adobe Developer Article talking about Creating marketing platforms in Flex. I did my first set of coding locally forgetting that my server did not handle Tomcat. So I said okay, and cut some corners and then some other limitation came up and I cut some more corners. ...

Flex 3 Close UrlLoader throws exception

I am trying to simulate a 'HEAD' method using UrlLoader; essentially, I just want to check for the presence of a file without downloading the entire thing. I figured I would just use HttpStatusEvent, but the following code throws an exception (one that I can't wrap in a try/catch block) when you run in debug mode. <mx:Application xmlns:...

Incorrect signature - Flash Facebook API [Please Help]

I've spent an entire day trying to figure out how to make this error go away: Incorrect signature I'm using as3 for my a flash file, which is embeded in iframe canva. I can connect properly: this.fbook= new Facebook(); var webSession:WebSession = new WebSession(api_key,secret_key, session_key); fbook.startSession(webSession)...

How to prevent Flash Builder from running/debugging from the cache?

I've been bitten by this a few times, and when it shows up it can make simple problems very difficult to solve. For example: var x:int = y + 1; if(x < y) { trace("Okay, you got me."); } Under what conditions will that trace show up? Normally it shouldn't, but if the player is using its cache it might. Sometimes I don't realize what'...

How do I play back a WAV in ActionScript?

Please see the class I have created at http://textsnip.com/see/WAVinAS3 for parsing a WAVE file in ActionScript 3.0. This class is correctly pulling apart info from the file header & fmt chunks, isolating the data chunk, and creating a new ByteArray to store the data chunk. It takes in an uncompressed WAVE file with a format tag of 1. T...