actionscript-3

Can an AIR app be programmed to handle a URL protocol?

I'm writing what is essentially a browser in Adobe AIR (ActionScript, not AJAX). A great bit of functionality to implement would be protocol handling. iTunes, for instance, handles itms protocols; when your friend sends you a link beginning with "itms://", it's going to launch iTunes as long as it's installed. Is there a way to write an ...

Accessing function defined in a SWF object from javascript requires a time delay

Hi, Is there a way to avoid the time delay required to access the functions defined inside a SWF object after dynamically adding the object to the DOM. for example, 1) I'm using swfobject.js api to add swf object dynamically add the SWF object to the DOM. var oSWF = new SWFObject("SWF Object path reference","SWF object ID", "100%","7...

Problem parsing XML data to Multi dimensional array

Hi there, i'm still transitioning from as2 to as3, i'm having trouble with parsing XML data to Multi dimensional array, below is the onComplete handler which is succesfully tracing 'event.target.data' but outputs 'A term is undefined and has no properties' when tracing _vein_data[0][0].xPos . I'm guessing there is a easier way to approa...

count clicks using actionscript 3.0 in flash

I want to change the variable value based on the number of clicks. So if you click the button once, the cCount should equal 1 and twice it should equal 2. Right now all I'm returning for the value is 0, no matter the amount of clicks. Any ideas? btnRaw.addEventListener(MouseEvent.CLICK, flip); btnRaw.addEventListener(MouseEvent.MOUS...

How to find the path to the user's Temp folder from Flash/AS3?

How can I find the path to the user's temp folder (e.g. C:\Users\lisnil\AppData\Local\Temp) from Flash/AS3? It needs to work on any version of Windows, at least XP, Vista and 7. ...

How to add a new Stage to my default stage?

I want to add a new Stage called field to the default stage (i need to place different elements on it later). And then i want to add a bitmap called myBitmap to the field. But nothing happens. I don't understand what should i do... var field:Stage = new Stage(); field.x = 200; field.y = 200; ...

How can you tell if an XMLlist object in AS3 contains a node?

How can you tell if an XMLlist object in AS3 contains a specific node? For ex: you have this XML file <items> <item>one</items> </items> And want to check if in this file exists a child with tag <pp>? ...

XML cached in local testing

Hi, My question is about XML loading. I need to avoid xml caching. On a web server, the technique is adding a random param to reload each time the XML file. But on local testing (in Flash CS4 IDE, CTRL + Enter), the following lines are not possible : var my_date : Date; path = "toto.xml?time="+my_date.getSeconds()+my_date.getMillisec...

How to scale rotated objects properly in Actionscript 3?

This is unfortunately a quite complex issue to explain, so please don't get discouraged by the wall of text - it's there for a reason. ;) I'm working on a transformation manager for flash, written with Actionscript 3. Users can place objects on the screen, for example a rectangle. This rectangle can then be selected and transformed: mo...

How can I use Action Script 3.0 to make random placed Symbols fly by?

I'm trying to make a simple animation with Flash CS4 and Action Script 3.0 to make a number of Symbols fly by from right to left constantly. What I want is that once a symbol has reached the end of the screen it is destroyed and another one is placed at the start position. I intend to give each symbol a random speed and create a random...

I want to use the fleximage gem and s3 for storage, but don't want dev/qa/test envs to use s3

I have a rails app that I'm going to host on engineyard and want to store image files on s3. But I don't know if I want all developer machines to beusing s3 for storage of all our test and dev images. Maybe it's not an issue -- but it seems like a waste to have everyone storing all our images in s3. I've heard of some ppl who store ima...

Advance from current position, Tweener, AS3

I want my animation to advance 120 pixels each time. Instead, my animation goes back to the bottom, rather than advance from it's new position. It assumes a new position, but always go back to the bottom first. How do I get my animation to advance from it's current position each time? GOAL I want my animation to advance 120 pixels from...

YouTube API Security Error Flex

Hi, I've tried to use the YoutTube API within a Flex project. But i got this error: *** Security Sandbox Violation *** SecurityDomain 'http://www.youtube.com/apiplayer?version=3' tried to access incompatible context 'file:///Users/YouTubePlayer/bin-debug/YouTubePlayer.html' Here are the two files: <?xml version="1.0" encoding="utf-8...

Call a variable's content in a URL - AS3

I have this variable and XML object (np tag) var addedNumber:String; for (var i:int=0; i<xmlList.length(); i++) { var picURL:String = xmlList[i].url; var picName:String = xmlList[i].username; var addedNumber = xmlList[i].np; etc... and I need to call this variable content here, inside a dynamic url function navigateToRight(evt:Mouse...

reset, Tweener, AS3

How do I reset my numbers after they count? I want something like an onComplete function. DESCRIPTION My animation advances 120 pixels from it's current position, then flys off the stage. It was looping, and would yoyo to the bottom before advancing. I don't want my numbers yoyoing or flying off the stage. My numbers must move 120 pixel...

AS3: Make sure children stays inside parent movieclip's shape

Red: Shape inside parent movieclip, Yellow: Children inside parent movieclip I'd like to animate the yellow dots, but make sure that they never gets out of the red shape's boundary. How can I approach this problem? ...

How can I set the size of SWF-application in ActionScript project (Flex builder 3)?

Silly question.. I need to set the size of SWF up to 800x600. But i don't know where can i change this property. There was an idea to change stage width and heigth, but nothing happened=( ...

How can I have an mx:Window automatically resize to its content?

I'm creating windows in a Flex application (AIR) using the mx:Window component. I'd like the window to be automatically sized to its content (because it will be dynamic), in the same way that an mx:Panel or mx:Box would be. I've customized components before, so I'm somewhat familiar with the UIComponent lifecycle, but I'm not quite sure...

loading child swf as3

Hi, I've been given an fla to make some changes too. Basically its a fairly long timeline animation with sound. So far I've successfully added a few button functions for sound etc.. but one has got me stumped. One of the buttons needs to load a child swf. I'm using the code below but I'm recieving an error - 'Error #1009: Cannot access...

Getting data from function loaded after current function

I have 2 functions, 1 loaded before another. Some value are determine by the other function data, but since one of it has to load before the other 1, how should I get the data that is loaded after current function? private function wMessage():void { Message.width=Name.width+20; } private function wName():void { Name.x=(Message.x+...