actionscript-3

Can I use apply() with constructor to pass arbitrary number of parameters

I've got a function wich can accept a varible number of parameter with a rest operator. I want create an object passing the argument collected with the rest operator directly to a constructor without create an object and call an initializing function and without passing the entire array but the parameters ah I do with apply() function...

AS3 - Keep getting a "Package is Unexpected" error in Flash CS5

I'm trying to use one of Adobe's examples to put a video player in my Flash application using ActionScript 3 in Flash CS5. It's the one at the bottom of the page here: http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/fl/video/FLVPlayback.html#buffering I'm putting the ActionScript into the frame I want to play the video i...

Drag-drop AS3: how to drag child mc out of parent mc and add to new parent mc

Here is a working script to drag drop a ball from the stage into another target mc: ball.addEventListener(MouseEvent.MOUSE_DOWN, pickUp); stage.addEventListener(MouseEvent.MOUSE_UP, dropIt); function pickUp(event:MouseEvent):void{ var ballPoint:Point = ball.parent.localToGlobal( new Point(ball.x, ball.y) ); ball.parent.r...

Actionscript 3 shareable functions (interfaces?)

Hellow, I've been working on OOP methods lately, and here is something I've always been wondering. Let say we have the following situation. We have a collection of pets [dog, cat, mouse]. Each pet has the same behaviour: running, eating, sleeping. Furthermore, they all have a different visual representation. Instead of making 3 seperat...

Flash 10, AS 3 - textarea problem - shows 2 lines when htmlText is set

hi everyone... I am using a TextArea. I set its htmlText as follows: textArea.htmlText = '<P ALIGN="CENTER"><FONT FACE="_sans" SIZE="14" COLOR="#FFFF00" LETTERSPACING="0" KERNING="0"></FONT></P>'; The problem is that there are always 2 lines in text area when it runs......when i remove this i get usual one line but then i m not able...

Organizing Long Scripts In Separate Files?

In an attempt to organize my code, I'm trying to split up my (lengthy) main controller class into separate files, but my new files must still have access to the variables and functions of the main controller class. I'm trying to cut and paste code from my controller class into a new class/file, allowing the controller class to call the ...

Change BorderContainer background color with AS - Flex 4

I'm trying to change the background color and or text color of a BorderContainer in flex 4 using Action Script, but have not idea how to. The Border Container component doesn't seem to have any properties like: idname.color = "#333333"; idname.backgroundcolor = "#333333"; How might I go about doing this? thanks! ...

AS3, flash 10 - click on color button and write in textarea with that color font

hi everyone I want to do as follows: * click a "red" button * write in textarea with red color font * click "blue" button * write in textarea with blue color font Isn't this possible in flash 10 using AS3 ?????? I tried using setTextFormat but the problem is i have to have text before inserting format on that. This is what i want: ...

Upload image trong AS3

Có ai biết upload ảnh dùng AS3 ko chỉ mình với ...

Fullscreen mode loaded when opening Flash Player

Is it possible to make a flash player go full screen (not in browser)? Would there be any bug / error on different version of Flash player? ...

as3 real fireworks

Is there any actionscript 3 class for fireworks that looks like real and not just some kind of bubbles? ...

ActionScript - Installing Documentation For Your Own Classes?

Is it possible to write/install your own documentation for self-created classes along with Adobe's documentation in Adobe Help? ...

How to get rid of a thin gray border of SkinnableContainer in design mode

I'm learning skinning techniques for flex 4 and spark. For an example I've created custom component derived from SkinnableContainer. It is simple container with surrounding frame and a title. Everything works just fine when I run test project with a component on it. But at design time my components border is not visible, so developer us...

AS3 Refresh Stage

Hello, I have been using the evt.updateAfterEvent() whenever a mouse is clicked. Is it possible to call an update on the entire stage to remove any pixels which are no longer being used? Thanks ~ Kyle. ...

Can I use the Facebook graph api to get user's friends profiles pictures ?

hi. I'm new to facebook development, after testing the adobe api in a flash game I decided to test using the graph api communicating with my flash game. After doing basic stuff like connecting and getting my user's data, i was wondering if it's posible to get my user's friends profile pcitures, so i can pass them to UILoaders inside my...

Flash Actionscript 3 SimpleButton doesn't have focusEnabled property?

This is driving me insane. I am working in Flash (not Flex) with Actionscript 3. I have an instance of the class SimpleButton. I have a TextField that I don't want to lose focus when the user clicks my SimpleButton. It is my understanding that both Actionscript 2 as well as the Flex class 'Button' both have a settable/gettable proper...

Set time 5 seconds to dispatch cairngorm event in flex

Hi, I have a live chart. I need to refresh the chart with 5 seconds time interval. For displaying the live chart i disptach the event (myEvent) extends cairngormevent. And after 5 seconds , the same event has to dispatch again adn get the data to display thelie cart. And how the event dispatch after 5 seconds with out any manula cal...

Simple post to Facebook page from flash using querystring

Hi Can someone point me to a simple example of posting to a user's facebook pages using a query string? ie I'm not using facebook connect. ...

Data Grid not displaying data in array collection

My data grid is displaying stale data, rather than the real time data available in it's data provider (array collection). I've tried refeshing the data in the collection, but that has no effect. Below is my code, does anyone see what could be the problem? <mx:Accordion/> <fx:Script> <![CDATA[ private var _gridData:ArrayCollecton = new ...

Different MD5 with as3corelib

I'm trying to md5 some file with as3corelib, but if I compare the as3 hash with a php one, I get different strings. That's what I do: _loader = new URLLoader(); _loader.load( new URLRequest( "image.jpg" ) ); _loader.addEventListener( Event.COMPLETE, completeHandler ); private function completeHandler( event:Event ):void { var d...