actionscript-3

How can I scale an OSMF player in ActionScript 3/Flex

I am trying to create a simple video player SWF using the open source media framework in Flex 4. I want to make it dynamically scale based on the dimensions of the video, input by the user. I am following the directions on the Adobe help site, but the video does not seem to scale properly. Depending on the size, sometimes videos play lar...

Actionscript change default coordinate

I have a sprite inside another sprite SpriteB is inside SpriteA I would like to change the default coordinate(top left corner) to say 250,10 When SpriteB.x = 0, SpriteB.y = 0 puts SpriteB to 250,10 in SpriteA Is this possible? ...

Stopping some sounds from dynamic classes, and exlude some others.

The sound I wanted to stop or play are separates into background music and button sound effect. I know you could use SoundMixer.stopAll() to stop all sound, and some how exclude the bg music, IF everything is written in the same class. But what if the sounds are called from others dynamic classes? How could I target them and exclude the ...

flash cs4: how can i change mouse cursor as if i'm on a button ?

Hiya. I have some MovieClips that act like buttons, how can i do that when the user hovers on the movieclip, the mouse cursor will change to a hand or the default cursor when it hovers a button. i don't want to create my own custom cursor, i want to use the default set of cursors that come with flash. thanks using flash cs4, action sc...

syncevt.changeList[cl].name sometimes is "clear" instead of "success"

I use shared object to drawing line. But sometimes syncevt.changeList[cl].name is "clear" insted of "success" and value of setproperty become undefined. Have any solution for this problem? ...

make width of child components to be 100%

I usually write something like this: <mx:VBox height="100%" width="155"> <mx:Button label="b1" width="100%"/> <mx:Buttonlabel="b2" width="100%"/> <mx:Button label="b3" width="100%"/> <mx:Button label="b4" width="100%"/> </mx:VBox> ...

AS3: child object outside parent.

Im using the following code to place an object inside a container: testParent = new MovieClip(); testParent.graphics..beginFill(0x0000FF); testParent.graphics.drawRect(50, 50, 300, 300); testParent.graphics.endFill(); addChild(testParent); testChild = new MovieClip(); testChild.graphics..beginFill(0xFF0000); testChild.graphics.drawRect...

special characters embedd in flash new TextField(); method in action script 3.0

How to enable special characters in var txt:TextField = new TextField(); in action script 3.0. var tf:TextFormat = new TextFormat(); tf.font = "Verdana"; tf.size = 12; tf.bold = true; tf.align = "left"; var txt:TextField = new TextField(); txt.text = _label; txt.embedFonts = tr...

reverse square root: in a Math lib or how to calculate it

Does Actionscript have a function that would tell me what number the input is a square root of. For example: 4 //output 2, because 4 is the square root of 2 16 //output 4, because 16 is the square root of 4 ...

This codes in Actionscript-2, Can anyone help me translate it into AS-3 please ?.......a newby pulling her hair out !!

this.createEmptyMovieClip('mask_mc',0); bg_mc.setMask(mask_mc); var contor:Number=0; // function drawCircle draws a circle on mask_mc MovieClip of radius r and having center to mouse coordinates function drawCircle(mask_mc:MovieClip):Void{ var r:Number = 20; var xcenter:Number = _xmouse; var ycenter:Number = _ymouse; va...

doubt regarding carrying data in custom events using actionscript

Hi I am working on actionscript to generate a SWF dynamically using JSON data coming from an HTTP request. I receive the data on creationComplete and try to generate a tree like structure. I don’t create the whole tree at the same time. I create 2 levels, level 1 and level 2. My goal is to attach custom events on the panels which represe...

syntax for binding multiple variables within text

When binding multiple variables value1 value2 value3 in the same text field, do I do this: text="{some text value1 other text value2 and other text value3}" or text="some text {value1} other text {value2} and other text {value3}" I noticed both work, but which is the right way to do it and will work all the time. ...

I am trying to add a link on an Image

Hi, I am trying to add a link to an image using ActionScript. I do not see the link no matter what. Below is my code, Can you please suggest what am I doing wrong. <?xml version="1.0" encoding="utf-8"?> <mx:Application creationComplete="application1_creationCompleteHandler(event)" xmlns:mx="http://www.adobe.com/2006/mxml" layout="abs...

Robotlegs with SwfSuspenders and AS3Signals

a bit confused as to how my XML config file would change when switching over to Signals. Right now the 3 framework Commands I am using are defined as follows. Both ViewChangedCommand and the InitViewCommand are mapped to custom events. <type name='app.controller::StartupCommand'> <field name='dataService'/> </type> <type nam...

preloading a dynamic classes which loads its own content

How do you preload dynamic classes which loads its own content? cause theoretically speaking the classes doesn't have a size yet until it loads its content right? ...

Security behaviour in Adobe Air

Hi everyone! I am trying to load external SWFs in my Adobe AIR App. The loaded SWF is trying to access an URL to retrieve some informations via XML. When starting the SWF by itself it works fine. When loading the SWF from the File.applicationStorageDirectory i will get an Security-Error because the loaded App is executed in a local-with...

How do I post dynamic information to Facebook from Flash?

I am building a Flash site and I want to be able to allow the user to post dynamically produced information to their Facebook wall, but I can't find out any information within the Facebook developers documentation. Its simple enough in Javascript/HTML: <script type="text/javascript"> function callPublish(msg, attachment, action_link) ...

How to load an external swf to the main stage from an instanced child class?

Hi, I am trying to get an instance of a class to the load an external swf and show it. So far I have the following: 1) I wrote a class that uses the Loader class to load an external swf "loadExtSWF". 2) I have a fla named "MainSWF.fla" that uses a document class "MainSWF.as". 3) I have the MainSWF.as file that instances "loadExtSWF" an...

How to create an image from array of pixel colors? (Flash, Actionscript 3)

I have a Width and Height parametr. I have been given an array of colors in such format: [r, g, b, a, r, g, b, a, r, g, b, a... etc] Data can be acsessed by something like this for(var y = 0; y < height; y++) { for(var x = 0; x < width; x++) { r = data[y*width + x + 0] g = data[y*width + x + 1] b = data[y*width...

imports and package structure in as3/flex

I've got a problem how to organise files and packages in AS3/Flex project. A short intro to the problem: The files structure in the project is (and should stay) like this: libs/Class1/src/<files> libs/Class2/src/<files> libs/Class3/src/<files> The amxmlc compiler source-path variable points to: libs/ I need it because I have to ...