actionscript

ActionScript/Flex: bitwise AND/OR over 32-bits

Question: Is there an easy way (library function) to perform a bitwise AND or OR on numbers larger than 32-bit in ActionScript? From the docs: "Bitwise operators internally manipulate floating-point numbers to change them into 32-bit integers. The exact operation performed depends on the operator, but all bitwise operations evaluate e...

Why should I use MXML?

If everything that can be accomplished in MXML can also be accomplished in ActionScript and many things are easier to accomplish in ActionScript (loops, conditionals, etc) why take the time to learn MXML? The best reasons I have at this point are that the structure of the MXML nicely matches the visual hierarchy of the UI components and...

AS2 Version of MovieClip.getChildByName()?

I'm trying to be responsible with my "DOM" references in this little Flash 8/AS2 project. What has become increasingly frustrating is obtaining references to other movie clips and objects. For example, currently my code to access the submit button of a form looks something like this var b:Button = _level0.instance4.submitBtn; I was ...

Best place to put prototype code in Flex project

I'm making a Flex project, using the Cairngorm library, and trying to keep the code in a good MVC structure. I just added some code to add a prototype function to a built-in class (I added the method "contains" to Array), and I'm wondering what you would consider the best-practice for where to put this code in my project structure? ...

How do I bind a function to a component programatically in Actionscript?

I am trying to provide my own labelFunction for a CategoryAxis programatically but am completely stumped. The regular way is to do it in your MXML file, but I want to do it in my Actionscript file. The regular way of doing it is: <mx:Script> <![CDATA[ private function categoryAxis_labelFunc(item:Object, prev...

What might cause connection errors when using bidirectional localConnection in Flash?

I'm trying to setup a bidirectional localConnection (LC) between two flash objects on the same web page. One object is AS2 and the other AS3. I'm using one LC object to send and receive data on each swf. (This shouldn't matter, right? I tried using two objects, one for sending and one for receiving, but got the same problem). They .c...

Where to begin learning Flex and Flash

I want to start developing Flash and Flex applications so that I can put all of the concepts floating around in my head into action. The problem is that I have never done any programming nor dealt with code...ever. I have worked in the graphic design industry and a lot of the storyboarding features in Flash are intuitive to me. Additiona...

How do I create a list control with Rich text in FLEX?

I am a FLEX newbie, trying to port a Javascript-based prototype into FLEX. One thing my original prototype had was an unordered list (ul) which had list items that had rich text inside it, i.e. I had a mix of differently styled and colored text and some images inside each item. I looked at the List control for FLEX and it only supports d...

Actionscript Object(Class?) Syntax

In trying to learn how to create objects in ActionScript, I have had no success. One thing that I have noticed is that there seems to be a billion different ways of doing it. Even if none of them have worked for me. This is really confusing me, and I don't know which approach to try to debug. The approach that seems to come up most of...

Convert encoding in flash actionscript 3

Is there any function like php's mb_convert_encoding which can convert an encoding to another? I want to convert the utf-8 text, passed in a input field inside the flash, to iso-8859-7 encoding. ...

Flex: How can I Load data, then create required components?

I have a flex application that has three tabs. Each of these tabs has a component that loads a ‘form’ that has a dropdown combo box. These combo boxes depend on external data in order to populate correctly. Currently the first tab is being created and the data that should be populated in the combo box is not in there. The combo box for t...

Is it a bad idea to get rid of the mx: in your Flex code?

I am a newbie at Flex, and I don't like the way you have to write the namespace mx: for every control declaration you write. It makes the code cluttery. I would like to write: <Panel ... rather than <mx:Panel ... I tried writing xmlns="http://www.adobe.com/2006/mxml" for the top level element instead of xmlns:mx="http://www.ad...

.Net or COM Library to read SWF Actionscript

I'm looking for a library to read a SWF file and let me parse through its actionscript and header information. Is there anything out there that will work? ...

How to create a 'global event' in actionscript / flex?

What is the best way to create a 'global event' in flex/actionscript - preferably using a static class? I want to raise an event to indicate that a stylesheet is loaded in order to show components that require that stylesheet. So I want each portion of the application that requires a style from the stylesheet to listen to an event telli...

Flex dataGrid itemRenderer, access cell width and height

When writing a custom itemRenderer, how do you reference the height and width of the grid cell that it will be rendered in? In such a way that it will resize correctly when the grid is resized. I am writing a dataGrid itemRenderer that draws a bar graph in the final column of a table. I have tried referencing 'this', 'this.parent', an...

Can a NetStream publisher in Flash pause their stream?

I'm working on a webcam video streaming application utilizing Flash 8 (AS2) and Flash Media Server 3. Streaming the video live is fairly trivial, but I want to give the publisher the ability to pause their stream, effectively giving the people watching a snapshot instead of realtime video. NetStream has a pause() method, but the docume...

Trouble linking SWC file

I am trying to link the as3corelib library to use their JSON functionality following this tutorial. But am having trouble compiling it. My command looks like: mxmlc --strict=true -library-path+=as3corelib.swc --file-specs myapp.mxml But I am getting this error: _divided_mx_managers_SystemManager.as(13): col: 14 Error: Interface me...

How to Burn a Data Driven SWF to CD/DVD?

I have a movie which is made up of a series of SWF files that read XML. Is there any way to burn it to a CD/DVD or at least convert it to a 'burnable' format such as AVI, MPEG, or ISO? Currently in order to burn it I have to so some funky screen capture stuff and recorded it to a DVD that way. ...

How can I dynamically edit XML node values in ActionScript?

/* I start with this: */ <Report> <prop1>4</prop1> <prop2>2255</prop2> <prop3>true</prop3> <prop4>false</prop4> <prop5>true</prop5> </Report> /* I want this result (change the value of node "prop5"): */ <Report> <prop1>4</prop1> <prop2>2255</prop2> <prop3>true</prop3> <prop4>false</prop4> ...

Test if an object is defined in actionscript

In actionscript, how can you test if an object is defined, i.e., not null? ...