actionscript

Scripting and Programming

Where does Scripting ends and Programming begins? ActionScript 3 and JavaScript/JScript are so different... ...

What is a good Actionscript 3.0 book for experienced developers?

So, I need a book (I know the API-docs, but I like books I can hold on my hand and take on the bus, etc.) for ActionScript 3.0 - I already know a plethora of programming languages so no problem there, but all the books I seem to find for ActionScript 3.0 are of the sort "teach yourself ActionScript 3.0 in 24 hours" and they all begin wit...

Do you use an architectural framework for Flex/AIR development?

Given that Flex is still a relatively young technology, there are already a bunch of architectural frameworks available for Flex/AIR (and Flash) development, the main ones being Cairngorm and PureMVC. The amount of architectural frameworks is remarkable compared to other technologies. I was wondering how many of you use an architectural...

Load and play embedded SWF file in Flex / Actionscript

Hello friends! I'm trying to create / use a pre-loader in my flex application. The preloader is a SWF file which has 100 frames (1 for every percent of the loader progress). Basically I am trying to Embed this SWF file in my application, display it on screen and change the frame number being displayed as the progress completes. The c...

how do I override a setter function at runtime in actionscript?

Hi I have an AS class with setter and getter functions. I need to tweak one of this class's instances so that it's setter function will process the input before assigning it to the local variable. or, in a more elaborated way, what should I use instead of $$$ in the example below? class MyClass{ private var _legend:Array; function s...

Parse Error When Trying to Set a Break in Flex 3

I have been trying unsuccessfully to set a HTTP break in my Flex 3 project. Obviously, I am totally clueless about programming and I don't have many references. When I try to export the project I receive parse errors for the result handler and var fault string. I am attaching a code snippet of where I have been placing the break. <mx...

Serialize Flex Objects to Save/Restore Application State

Is it possible to serialize a hierarchy of objects in Flex, send the binary data to a URL for storage/retrieval on/from a server, and deserialize the data to restore the objects' original state? I know it's possible to convert the objects into an XML format (haven't tried it yet), but I'm hoping to avoid parsing XML and rebuilding the o...

Why is object returned from getDefinitionByName()?

In Actionscript 3, why does getDefinitionByName() return an Object when the docs say: Returns a reference to the class object of the class specified by the name parameter. Based on that, I would conclude that the returned object should be Class instead of Object. Can someone enlighten me why that is not the case? ...

Is function declaration allowed in function call for ActionScript?

I have the following code: var a= 1 + (function (x) { return x+1;} (2)); This is allowed in JavaScript, but in ActionScript, it's always show an error message, saying this line of code is wrong. I cannot find a documentation on ActionScript about this, anyone has any idea about it? Thank you in advance! I have a idea as : var a = 1...

Flash play() processed immediately?

Does the play() function in Flash: move the playhead of the MovieClip to the next frame -- as soon as play() is called change the MovieClip's state to "playing" -- actually move MovieClip to next frame, when movie moves to next frame ...

Impossible to achieve a Zoom in/out with webcam using actionscript?

Hi I am guessing this is not possible based on the fact that my Google search did not yield anything! So asking the stackoverflow talent, is it possible for me to get webcams to zoom in and out providing the webcam has zoom capability? I am guessing no? This is for an image capture project that I am doing. Thanks all ...

How can I reference the TextInput of an editable ComboBox?

I have an editable ComboBox component and I want to reference the TextInput that is shown, in order to programmatically select the Text in it. This is very straightforward on a TextInput: private function selectNameText():void { nameTextInput.selectionBeginIndex = 0; nameTextInput.selectionEndIndex = nameTextInput.text.length; ...

flex preloader not working with # in the url (deep linking)

I can't get flash preloaders to work when there is a a # in the url of my page (even without any deep linking libraries or logic). I am using flex 3.3. Flash plugins 9 and 10, all browsers. There is this bug regarding # in the url preventing preloaders from working: http://bugs.adobe.com/jira/browse/SDK-14162 However, somehow, someon...

ActionScript - how to address instance by name?

Hi, i am new to Action Script and i have the following problem: i have global variable tabName and a button, that changes its value, just like this: on(release){ _root.tabName = this._name; } and now i want to use String variable tabName to address curtain instance on stage to edit its property (actually, i want to control, which ...

How to make a movie with transparent background in a flash with transparent background

I want to make a flash like the one here http://www.multisoft.com/ (wait for the page to load). The nice lady in the bottom right of the page has a transparent background. I'm not interested in background of the flash (not the wmode stuff), but in the background of the movie itself. Is there an easy way to do that? Maybe a script that ta...

Ruby-like Question: Make this function shorter (ActionScript 3)

I just wrote this incredibly verbose code to turn numbers like 2 into 02. Can you make this function shorter, please (maintaning the functionality)? public static function format(n:int, minimumLength:int):String { var retVal:String = n.toString(); var stillNeed:int = minimumLength - retVal.length; for (var i:int = 0; i < stillNee...

ActionScript - What Programming Language Category is it?

Is ActionScript a scripting language or is it more an object-oriented programming language like Java? A quick check on Wikipedia lists it among scripting languages... ...

Convert AS project to Flex project in Flex Builder

Is there an easy way of converting a Actionscript 3 project to a Flex project in Flex Builder? When i right click on the project and hover "Flex Project Nature", all options are greyed out ...

Debugging a flash stack overflow

I have a swf that is being loaded by a third party swf. I have source code and recompile my swf, but don't have code to the third party swf. Somewhere, likely in my code, there's a stack overflow. In a debug flash player, I get a nice popup dialog with a stack trace when the overflow occurs: Error: Error #1023: Stack overflow occurre...

how to refactor code inside curly braces in flex

Data binding in ActionScript is really cool. But what if I want to refactor a big switch or if statement inside the curly braces into a function, for example: {person.gender == 'male' ? 'Mr.' : 'Ms.'} into: {salutation(person)} The compiler doesn't let me do that. I know about properties and I could write getters and setters on t...