actionscript

Flex: Is it guaranteed that code is excluded from compiled build when not reachable?

Suppose you have private static const INCLUDE_MY_DEBUG_CODE:Boolean = false; public function runMyDebugCode():void { if ( INCLUDE_MY_DEBUG_CODE ) { callADebugFunction(); } } private function callADebugFunction():void { ... } Given there is no other reference to callADebugFunction, will it be guaranteed that c...

Add/Tween/Remove - Multiple instances of the same MC (Tweenlite)

I'm trying to create a simple loop that adds a random number of stars, fades them out and removes them. The script I've come up with does everything but remove them, and perhaps I need a less on adding children to a stage. Here's what I come up with import flash.display.*; import com.greensock.*; import com.greensock.easing.*; // tim...

How to dynamically generate variables in Action Script 2.0

I have a for loop in action script which I'm trying to use to dynamically create variable. Example for( i = 0 ; i i++) { var MyVar+i = i; } after this for loop runs, i would like to have 3 variables named MyVar1, MyVar2, MyVar3. I know the code above will give you a syntax error, but that is just to illustrate what I am trying...

Image/ByteArray to SVG conversion?

I am wondering if it is possible to get a url to some image on google, say a square (jpg/png/gif), and process it into an SVG. Is this possible? Right now I'm getting ByteArray data in Actionscript by making a URLRequest('image/on/google'), with dataFormat="binary". I don't think Actionscript could handle/do it, but maybe it could. I...

How to create a flip book/page?

Hi, I need to create a flip book/page application. I have seen flash created flip page, can it be done in any other languages, e.g. jquery or javascript? And also, what are some concepts that I am required to have in mind/knowledge on for creating a flip book? Thanks. ...

Flash RemoteObject Weborb connection without services-config.xml (no Flex)

Context : I'm working on a Flash application developed with FDT and compiled with Flash CS4 (I need a huge library). It should connect to various Weborb services. Weborb is properly configured. My services are properly executed, and values returned, via the management console. Weborb examples as well as various tests compiled with Flex ...

advancedDataGrid with two providers

I want to have 2 dataproviders for 1 advancedDataGrid: 1 normal and second one for combobox in a one of columns. I want to have this combobox to have data from a column in database (i already have it in arrayCollection). I just don't know how to provide data for comboBox in a way that it doesn't have to read that data from database every...

Actionscript 3 mouseover passthough (ignore mouse events)

I have a button with a MovieClip over the top of it. Is there an easy way to tell flash to ignore the mouseOver events of the MovieClip in ActionScript so my button doesn't flash? ...

How can I get the background color of a loaded swf file ?

I'm loading an swf file into my main application using URLLoader, I want to get the background color of the loaded swf file. ( I heard that one solution wold be reading the byte code of the loaded swf ) ...

Dektop audio app - suggestions for how to build for Win/Mac/Linux?

I am a web developer well-versed in XHTML/CSS, JavaScript, Perl, PHP, and XML/XSL. I would like to write a desktop application for music teachers that manipulates audio files. The app will: Input one or more audio files Let the user pick in and out points of several clips Play those clips at the touch of a button with fade-in and -out ...

Flex: Text Input that accepts number only

Need a code that only accepts numbers. Upon inputting, the code must check if it is number, if not, it must remove the entered key or not enter it at all ...

how to change a external swf's dimention in Actionscript project?

Hi I used Loader to load an external swf file, and try to display it in a fixed area, like a fixed dimention sprite object. And I dont know the exact size of the swf file, I just want it to fit the fixed area. Is that possible? code: var loader:Loader = new Loader(); loader.load(new URLRequest("some path")); loader.contentLoaderInfo...

Datagrid scolling issue - Flex

I have a DataGrid, <mx:DataGrid styleName="alternateColor" verticalScrollBarStyleName="verticalScrollStyle" headerSeparatorSkin="uiExtensions.DataGridHeaderSeparators" width="100%" height="100%" editable="false" color="#000000" verticalGridLines="false" variableRowHeight="true" itemEditEnd="processData(event);...

Render Embedded Fonts to a BitmapData in AS3 / Flex

It seems that rendering fonts to a BitmapData in Flex is quite easy. You create a TextField, populate its properties, and the BitmapData's .draw() will accept it. The problem comes in when you attempt to enable embedded fonts. Here is an example of what I'm trying to do: ResourceManager.as: public final class ResourceManager { /* .......

Custom Actionscript 3.0 Events: Build separate Classes for different purposes or use one for all?

I'm using custom Events in Actionscript 3.0 for the first time and I'm unsure about how to best design them. I need a couple of Events. Some of them need to transport different kinds of data and some don't. Now I don't know whether I should use a single class to implement them all or use separate classes for different kinds of purposes. ...

Action Script 3 get sounds total time and current time?

Hi, i have a player in flash action 3. i need to take a the total time of the sound file and current time of the sound file. how can i code like this. function onPlayProgress(evt:Event):void { var sndLength:int = Math.ceil(snd.length /(snd.bytesLoaded / snd.bytesTotal)); var seekbar = 100 * (channel.position / sndLength); ...

Why is iconField ignored for branch nodes with the Flex Tree component?

I'm using the iconField property of the Flex Tree to dynamically set the icon that a node should use. This works fine for leaf nodes but for branch nodes it doesn't seem to respect my iconField and instead just shows the default folder node. Here's a simple repro: <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absol...

read content of file with php and send to flex via amfphp

Hi I am creating some application in flex and one of my purposes is to read content of file and display it in flex. There is huge problem, when I have file written in polish (which contains some special characters) because amfphp transfers this contents few seconds, which is to long (reading and sending content of file without any polish...

Problem modulating action script project

I am refactoring a hugh action script solution in Flash builder (beta 2) using the flex 4 sdk. The project does NOT use the mx framework. What i want to have is: A big 'MAIN' project several small 'MODULE' projects. each 'MODULE' class refrences the 'MAIN' project as an External reference (doesnt compile into swf) - this is done by se...

Can't make navigable rendered component

Hello. I have the next component, which is substituted into the data grid as rendered item. <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" click="navigateToURL(new URLRequest('{data.GetLink()}'), '_blank');"> The problem with click event, it doesn't work. How correctly to make navigation VBox that url is substituted from the d...