actionscript-3

Flash: Pass constructor arguments to objects placed on stage?

Is it possible to pass constructor arguments to instance objects which I place on the stage? Are the instantiations of instance objects centralized somewhere as with .NET WinForms so I can just edit the xxx = new CustomRecangle() constructor? public class CustomRectangle extends MovieClip { public function CustomRectangle(...

Hide my jpg files

I develop a game that will have to load jpg images that now i just put in the same folder where swf file is, in order to load them when it is needed. Is there a way to somehow embed all this stuf in the swf so that i will have to deliver only the swf file? ...

Flex: Animate an image how to do it in as3

Hi! i am having problems with animation. Can't realize how to animate things in flex? E.g. in my current self made project I want to make am image to move after response from server. E.g. after event on client side is made, server returns coods of new location of an image. How do I animate the movement? Examples will be appreciated, ...

How do I access the Document Class' properties from the time line in AS3?

I am building your standard slideshow flash header for a web page. There are three main parts: The Slideshow class A controller class that is used as the projects Document Class Some linking timeline code. The slideshow class has all the functionality, so I used the Document class to create a new instance of the slideshow and ke...

error using timeouts in flex3/actionscript

Ok, this is what I have so far - but it gives me an error saying that I am missing a semicolon somewhere, but I cant figure out where. Basically what I want it to do is when the button is clicked a random number is generated, then one pic is hidden, one is shown - then after a pause, that pic is hidden and a different one is shown. <mx...

What is the class of an Embedded asset?

What is the class of an embedded asset? [Embed(source="picture.png")] public static const picture:Class; what is the class of: new picture(); what superclasses does it inherit? i thought it would be Sprite, but it gave me a TypeError. ...

How do you read a jpg creation date in Flash using AS3

I'm loading thumbnails repeatedly in a sequential order. 01.jpg 02.jpg etc. I need to know if they're failing to be produced. The only way I can think of is to read the creation time of the jpg, so I can verify that it's been updated. Anyone know the best way to read creation time in jpg in as3? I didn't see that in the headers by pars...

How to send parameters to swf not using any html?

Is it possible to send params to swf using SWFLoader or something like it? So.. I want to create swf loader (swf) which would be able to send some Application.application.parameters to swf swf I'm triing to load (which are usualy sent to an application from html.) how to do such thing? ...

Removing Tween For Garbage Collection in AS3

i'm trying to remove a tween object after it has complete so the memory can be freed by garbage collection. in this example i'm passing the fadeIn function a UILoader object that is cast as a sprite so that it fades in when it is finished loading. when the tween finishes animating, i want to remove the tween object. i've included the ...

How to filter sound coming from microphone in flash (10.1)?

I hove some sound coming from microphone. i need to add sound filter to it and to play it to the guy which talks into that microphone. How to do such thing? ...

What live sound editing\filtering libs are there for flash developers?

What live sound editing\filtering libs are there for flash developers? ...

How to load flex swf from flash?

I have some swf compiled in flex I want to load it into my movie clip in flash pro. ...So how to for example load flex swf inside Flash CS4? how to do such thing? ...

In actionscript 3, how do i address objects that aren't on frame 1?

Hi, I have an object (button) on frame 2 of my timeline, with the name btnMenu. When clicked, i want to return to frame 1 in the timeline. Actionscript 3 does not allow me to bind the eventlistener to the button from my code on frame 1. Layout: layer 1: Actions, only on frame 1 layer 2: btnMenu, only on frame 2 (with an empty frame i...

Accessing a Clip Inside Another Clip in a Loaded SWF-File

I'm writing a card game in AS3. The artist I'm working with has produced (in Flash CS4) a single swf-file containing all the card graphics and animations. The structure of the fla working file looks something like this: - Scene - CardGraphics (Movie Clip) - CardFront - CardBack - CardValueImage (Movie Clip) ... In th...

is it possible to get the duration of a streaming mp3 in Flash

Hi, I'm wondering if it is at all possible to get the total duration of an mp3 being streamed in flash? At the moment I'm using the following code to estimate the lenght but it is always inaccurate var loadTime:Number=_track.bytesLoaded / _track.bytesTotal; var loadPercent:uint=Math.round(100 * loadTime); estimatedLength=Math.ceil(_tr...

retrieving Twitter user info doesn't work in flash

Hi I'm building a Twitter search application in Flash and have encountered a security error when retrieving a user's information using the following... http://api.twitter.com/1/users/show.xml?screen_name= I noticed a crossdomain.xml file returned with the above. This works http://search.twitter.com/search.atom? Can anyone suggest a ...

Update movieclip positions

I have a number of movieclips added to the stage dynamically and positioned relative to the order they were added so they make a nice list with a little space in between. I have a button on each that removes the movie clip from the stage if need. I need to run a function to loop through the remaining movieclips and re position them so th...

How to create modules in Flex Builder with AS3

Hi, How can I make different modules and a main project in FlexBuilder for a pure AS3 project. There is documentation for MXML modules but could not find anything for AS3. ...

Flex: Moving canvases between several ui elements

I need to animate a lable movement between 2 canvases... The mxml example of the code is: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="main()" frameRate="1"> <mx:Script> <![CDATA[ import mx.controls.Label; public function mai...

Flex Datagrid: Creating a timetable

Hi guys, I have some data passed into the flex via webservices, and want to create a timetable. As of current, I have a timetable but the day is a column, time is a column and so on, by mapping the datafield to those columns. I need to flip this around and have all day columns and one time column, with each day column filter to the day...