actionscript-3

Embedding all font glyphs in an external font.swf

I need access to a range of font glyphs for a localized flash application. I am using Myriad Pro which supports character sets such as Greek and others. Is it possible to embed all font glyphs by simply adding the font to the library and checking the option Export for Actionscript? ...

Flex: Set LineChart to append dataProvider values horizontally to show growth over time frame

Basically the default behavior of the horizontal axis of the line chart is to graph each plot "as is" for example if you had this data: <data value="5"> <data value="6"> <data value="7"> would graph, 5|6|7 I would like to make it graph so that it is adding to a value as it goes horizontally so it would graph the numbers like this: 5|...

Using Enter_Frame as a timer Flash

I am trying to save memory and space. So instead of using the Timer for my application, I was thinking about using my main loop (ENTER_FRAME) to keep track of time that passes. Is there anything wrong about this ?? ...

Flex: Create custom stroke on LineSeries?

You can easily set a stroke on a line series like this: <mx:LineSeries yField="apple"> <mx:lineStroke> <mx:Stroke color="0x6699FF" weight="4" alpha=".8" /> </mx:lineStroke> </mx:LineSeries> This will set alpha for the entire stroke to .8 But I want...

Objective-C-Cocoa book recommendation for an AS3 developer.

Hi Just looking for more recommendations for great Ojective-C-Cocoa books. My ideal book would be one with actual hands-on walk thru examples increasing in complexity and doesn't spend unnecessary time on basic OOP. Trying to leverage what knowledge I DO have in Actionscript 3. (or maybe its all about unlearning?) ...

AS3: Merging XML Files

There are a number of posts on here about merging XML with Java, but I can't seem to find any reference to Actionscript for the same task. I have a group of XML files that I need to load. I want them to sort into one XML Object in memory. For example, let's say these were my XML files: File 1 <xml> <type name="1" group="a"> ...

How can I modify my code to line through the bezier control points?

HI all - I am using anchor points and control points to create a shape using curveTo. It's all working fine, but I cannot figure out how to get my lines to go through the center of the control points (blue dots) when the line is not straight. Here is my code for drawing the shape: // clear old line and draw new / begin fil...

MovieClip.onResize event? how?

I have a an swf, called 'controls' that I created with flash cs4. I upload the controls.swf to my web server. I create an application in flex and it loads the external swf controls into itself. So far I can manipulate the controls.swf via my flex app. I created a class in my external swf, but I need to add some onResize event/check to m...

How do you find a tight-fitting, axis-aligned, bounding box of a rotated ellipse in AS3?

The AS3 getBounds function returns a rectangle that is not fitting tightly to a rotated ellipse. Instead it returns an axis-aligned rectangle based on the bounds of a rectangle whose width/height corresponds to the max/min diameter of the ellipse and follows its rotation. The answer to a similar question on Stack Overflow elegantly outl...

only plays one key frame

I hope I explain this well. But in my game I have 3 keyframes for my bullet Movieclip. 1 to display its normal state. 2 to show it Blown Up, and 3 to remove it from the stage. A total of 3 frames. When the bullet hits an object, I go to and play the 2nd frame. then when frame 3 hits, I remove it. Here is my code private function blowUp(...

A way to create command line program with Air 2?

Is there any way to create an Air 2 program that runs just in the command line? (no windows, no gui, etc) Something similar to Windows Ping program. It would accept arguments and then output std out. ...

How to change the coordinate origin in Flash's stage with Actionscript?

I think I did this before but can't find the code. Flash as many other graphical frameworks use the top-left corner as the coordinate origin (0,0) because it's how the underlying memory model is by convention. But it would be really simpler for my calculations if the origin was in the center of the stage, because all the game revolve...

[Actionscript] Drag and drop into the collect slot?

For eg you have three boxes: A, B and C. Then you also have 3 balls: A, B and C. You are supposed to drop ball A into box A and etc. If you drop the right ball into the right box, you get 1 point; else you get zero points and the ball returns to the original position. I am supposed to use an image instead of A, B and C. How to detect if...

fonts not being embedded Flash CS4 AS3

Hi Maybe you can help me with a problem I am having. The URL of the project is: http://www.mauriciogiraldo.com/vgline/beta/ It is a Drupal-powered, AMFPHP-connected AS3 web app. The data goes through to Flash with no problems, I have verified that UTF-8 is fine and all. The problem can be better seen in these URLs: http://www.maurici...

Populate a datagrid from a Loop

I'm just starting to learn flex and AS3 I'm trying to get information into a datagrid that originates from a mathmatical formula. For example if I have 100 and I subtract 5 from it and continue to do so until it reaches 0 so my grid would be something like: 100 | -5 95 | -5 90 | -5 ... ... 5 | -5 0 I'm guessing that it needs to do so...

extending AS3's Array access operators to 'wrap' out-of-bound index values

I'd really like to be able to make Flash's array access syntax 'wrap' over the array's bounds. Lengthy explanation - var array:Array = ['a','b','c','d','e','f']; To keep things simple, the first index is 0, and its value is the first letter, 'a'. To get that value, we'd do this - array[0]; // returns 'a' As long as the index you'...

Possible to have Flex dataTips on Canvas rather than Chart objects?

Flex charts, like AreaChart, have wonderful built-in support for displaying data "tool tips" when a user hovers over a point supplied in the data of a graph. You can hover over any of the bar graph examples on this page for a demonstration. I have a graph situation where I optionally draw in some dots as reference points on CartesianDa...

Referencing other movieclips within actionscript class

I have externalized the actionscript code of a movieclip into a separate class files. This movieclip requires references to some other clips on the stage. What I am currently doing to reference those clips is by using Movieclip(this.parent).otherclip but somehow that feels wrong. Is there a better way to pass in the required references ...

How to reference Flex elements added during runtime?

This feels like a newbie question, so brace yourself. I am having difficulty getting a reference to elements added after compile-time using the 'id' property. I have seen a few forum topics suggesting that this isn't possible, and that getting a reference to elements added this way is trickier, but never just exactly what that trick is...

Speedup setTextFormat()

Hi, i've a text with a very long list of words to highlight and calling setTextFormat() one for each word takes ages. There's some way to speedup this operation ? i've tried with a TextField not instantiate in the DisplayObject's list, to bypass the rendering stage but i've founded that the performance are the same. Any ideas ? ...