actionscript-3

Flash/ActionScript: Draw a display object "onto" another

How do I properly draw one vector object onto a specific position of another in ActionScript, accounting for positioning, transparency, etc? My idea (as suggested e.g. here) was to use beginBitmapFill() and drawRect() to draw a bitmap copy (made using BitmapData.draw()) of one MovieClip onto the .graphics property of the other MovieClip...

Getting Started with Flex 3 UI ActionScript Programming

Are there any good resources for starting Flex 3 UI programming in ActionScript? I am having some issues with the following if anyone has any ideas. It gets the right size, but my buttons are not showing up. Anyone have any ideas? package { import flash.display.*; import mx.controls.Button; import mx.controls.TileList; ...

chage text on a symbol in Flash

I'm trying to change the text on several symbols by having a user press one designated symbol ! I don't care if its with flash 2.0 or 3.0 , I did a menu bar and want to change the text on the symbols if on symbol in particular is pressed ! I tried everything I could think of and expected it to be fairly easy ! I must be missing somethin...

using RegExp to split string but store whitespace (space or crlf) to items

sample input (orgtext = a[crlf]b[space]c[crlf] ) I like to store each word a,b, c to the words array with the original suffix crlf or space. Currently calling SPLIT drops the suffix as its separator, but I like to store separator as well. Can I adjust regexp to return also suffix and still split? Words = new Array; var ar: Array = ...

Creating an XML string in Flex (AS3) by using DOM functions

I want to create an XML string in Flex 3 in a similar way to you might approach it in Java. I only want a small piece of XML in the format <slide thumb="http://www.thumbs.com/thumb.jpg" type="static" blah="bleh" /> The only type of code I can find for doing this seems ridiculous.... private function createXML(): void { var xm:XML = <...

For (loop) dynamic creation in as3

Hello! I'm trying to create dynamic balls by using for loop. For some reason I get two objects (trace show 2 balls and their DIFFERENT properties), but on the stage I can see just a last one created. This is my code: var randomBall_mc:ball=new ball(); for (i=1; i<3; i++) { addChild(randomBall_mc); randomBall_mc.name="rando...

I have RTRIM; how to make LTRIM with regexp

I have RTRIM; how to make LTRIM one? public static function rtrim(string:String):String { return string.replace(/\s+$/,""); } ...

best way to use font colors with textField.htmlText

what is the best way to use more than 1 font color with textField.htmlText I already use code like: textField.htmlText = "blaa blaa" + "< u >"+w+"< /u >"+"blaa blaa" How can I make that to define a specific color as well? ...

How to stop Mouse Out event on Flex Canvas firing for child elements

Hi, I am using a Canvas itemRenderer for a container I use to display images. See pseudo code below. image = new Image(); image.source = data.@thumb; this.addChild(image); this.addEventListener(MouseEvent.MOUSE_OVER, enlarge(image)); this.addEventListener(MouseEvent.MOUSE_OUT, shrink(image)); When I mouse over the canvas, the enlarge...

How do you decide between using an Abstract Class and an Interface?

Duplicate: http://stackoverflow.com/questions/56867/interface-vs-base-class I have been getting deeper into the world of OOP, design patterns, and actionscript 3 and I am still curious how to know when to use an Abstract class (pseudo for AS3 which doesn't support Abstract classes) and an interface. To me both just serve as templates...

How do you set the proper width of a dynamic UITextField before assigning text?

In Flex 3.2, I'm creating a UITextField, then measuring text that I'm about to assign to that field's text property. I then use those metrics to set the size of the field. However, the calculated width is not wide enough to accommodate the text. Is there a different order to achieve proper measurement or am I seeing a problem with the...

What is the best Actionscript3 3D Engine?

I am looking for a somewhat detailed explanation of which 3D Engine for Actionscript3 is the most efficient, practical, scalable, documented, community supported, etc. When I first got interested in the 3D world for flash and actionscript3, all I knew of was papervision3D. In my curious way I went to read up on papervision3D and was sh...

What is the best IDE for actionscript3 development

I am currently using FlashDevelop for my Actionscript3 development. I have also tried my hand with using Flex3 for my Actionscript3 development. I was curious if FDT was superior to the former and that if it's cost out-weighs it's usefulness. Are there any other applications out there to help streamline the process? ...

Trigerring a change event in a Flex tree control programatically

I have a method to add an XML node structure to the currenltly selected tree node. This appends the xml, and opens the parent node to display the newly added node. I then select the node by setting the selectedItem of the tree. I have an editing form that updates its values on the tree change event. When I set the selectedItem in th...

Why does the actionscript3.0 class heirachy fail (sometimes)?

All Objects in actionscript3.0 inherit from the Object class, but the actionscript3.0 compiler seems not to be smart enough to understand this. take a look at the following code: package{ public class TestOne{ public function TestOne(){ var t2: TestTwo = new TestTwo(); trace(t2.toString()); // COMPILE TIME ERRO...

Multi-pages Flash application

I am very new to Flash and I need help to get started with building multi-pages Flash application. I managed to open another swf file (called Page1) from within the main swf by calling this function private function LoadExternalSwf(): void { var loader:Loader = new Loader(); var urlReq:URLRequest = new URLRequest("page1.swf"); ...

Flex - How to get Tree itemClick event to mimic itemOpen event?

I am using a Tree control with an XMLListContainer dataProvider.... I use an itemOpen event with the following code to update another data provider when a tree folder is opened (using small triangle) - the data provider contains all the <slide /> elements in that particular tree folder... private function itemOpenEvent(event:TreeEvent):...

Flash toggle button

I need a button in Flash/AS3 that toggles between on and off. So I was glad to see that the Button class has the toggle property that lets me have that behavior. I was less happy to see that what I get when I make something a "button" in the Flash file is an instance of SimpleButton class, which does not have that option. Is there a way...

creating a rounded button from AS3 ?

How to create rounded & good looking "OK" and "CANCEL" buttons from AS3 ? I dont want to use any images for these, just draw them? ...

TextField() Prevent ctrl+a (select all)

How can I prevent ctrl+a from functioning with editable TextField() ...