actionscript-3

When would it make sense to pass a function to a function?

Ok, so it is possible to pass a function to another function. http://stackoverflow.com/questions/148982/passing-a-function-to-another-function-in-actionscript-3 This is obviously very powerful, but a more important question is, when would it make sense to do so, as there are performance overheads whenever you call another function? ...

Get filesize of remotely hosted file

I'm looking for an AS3 function to get the filesize of a file that is being hosted on a remote webserver. Tried to find some functions but didn't succeed. Maybe somone can help me ? ...

what is dispatchEvent in Flash AS3?

Hi all i want to know what is dispatchEvent in AS3. I didn't get any idea while Googling it. :( So please help me Edit 1: public static const SET_VOLUME:String = "setVolume"; private function onclick(evt:MouseEvent):void { soundClip.scaleX = 0; dispatchEvent(new Event(SET_VOLUME)); } what does this means?? ( ...

why http post in some website work and same swf in my host http post not working in actionscriot?

http://www2.asis.co.th/megadig/SimpleHttpPost.swf and http://www.shinedraw.com/data-handling/flash-vs-silverlight-simple-http-post-request/ same swf but i download from http://www.shinedraw.com/data-handling/flash-vs-silverlight-simple-http-post-request/ and save to my computer and upload to my host but not working in h...

How do you encode XML safely with ActionScript 3?

I'm capturing data from the user and writing it to an xml string like so: var myXml:XML = {userEnteredText} This is fine and dandy until the user gets cute with special characters like "& < >" etc. Illegal characters are also a problem like 0x19. Is there are method that will sanatize my xml and encode special characte...

self-hosted online photo editor?

I am looking for an online photo editor like http://services.snipshot.com (Javascript) or picnik.com/info/api (Flash) but I need one that I can host on my own server.. been searching for a while but no results.. any ideas? I also love the idea behind pixenate.com/productinfo/Overview.html but its so expensive. ...

Masks in AIR with Actionscript 3

I'm trying to do a mask on a circle shape in ActionScript 3 (I'm using the Flex AIR framework). It has to do with the ecological footprint, each circle representing one earth. This ecological footprint picture is inside a container. The problem is that the mask seems to be fixed, though the picture floats. When I scroll the container dow...

URLRequest not working in Cross domain in As3?

URLRequest not working in Cross domain in As3? <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="init()"> <mx:Button x="35" y="22" label="Button" click="test()"/> <mx:TextArea x="35" y="65" width="365" height="254" id="aaa"/> <mx:Script> ...

How to set background color for a Flex actionscript 3 project

I am trying to set the background color of a Flex actionscript 3 project. I have tried all sorts of things, including this: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundColor="#FF0000"> </mx:Application> this: SWF(backgroundColor='0x000000', frameRate=...

How can I connect and get facebook profile information from a director apps (.dcr not .swf) ?

We currently have a director apps (.dcr not .swf) that we want to integrate with the facebook api. (to connect via facebook, to challenge facebook friend from within the game) Can I embedded a flash in the director apps that take care of connecting to Facebook ? From what I saw from my search it seem that most of the tutorial or answ...

Can i passing domain crossing in AC3 in function urlrequest?

can u passing domain crossing in action script urlrequest? i would like to some flex to used http post to post some script to form in website in ac3 but not working i find crossing in Google that must cross domain in web to use urlrequest anyone can help me by passing this can i do its? ...

Tree Component Drag And Drop Related

I am having a tree which has some root nodes and internally some child nodes. We can drag and drop between these nodes by enabling inbuilt properties like dragEnabled="true" dropEnabled="true" dragMoveEnabled="true". However, My requirement is that, while i drag and move a child node to upper side, It should not be dropped above the Root...

Accurate BPM event listener in AS3

I'm trying to sync animation to music at a specific BPM. I've tried using the Timer but it isn't accurate when dealing with small intervals in milliseconds. I did some reading and found an alternate method that uses a small silent audio file and the SOUND_COMPLETE event as a Timer. I used 167ms long sound file with this code. package ...

From Rectangle into trapezoid

Hi, how can i transform rectangle into trapezoid with ActionScript3 my trapezoid is a floor of 3D room, and i want to texturize it (bitmap tile). _____________ | | | | | |_____| | | / \ | | / trapez.\ | |/__________\| ...

YouTube video loaded into Flash MovieClip, can I get width and height?

Hello, I'm trying to load a YouTube video on a flash MovieClip using url http://www.youtube.com/v/4nRNoXT%5FgUc that returns the video with player directly. the video is loaded and i can manage it with his player, the problem is when i try to position it no the stage, because I don't know his width until it starts. I've tested it with ...

create HBox component with default values

I want to create a HBox component name for example HLBox that behaves exactly like an HBox but ha s as default width and height 100%. How can I do that? ...

Flash AS3 class Object calling methods

HI all, i have a class file named Main.as and another class calledr icon.as package { import icon; public class main { public var _time:String; function main() { _time="01:10"; iconObj=new icon(this); } function timerFunction() { _time=newTime; } } } package { public class...

AS3 ExternalInterface call using jquery

I'm calling into a flash app embedded in a html page using the ExternalInterface. The following code works fine (I'm using a button to test): $(document).ready(function(){ $("#button").click(function(){ var app = document.getElementById('ApplicationID') console.debug(app) app.pageUnloading() }) }) So th...

Get Enum from String in ActionScript3

Is there any way in ActionScript3 to get enum from string value? e.g. I have enum public final class Day { public static const MONDAY:Day = new Day(); public static const TUESDAY:Day = new Day(); public static const WEDNESDAY:Day = new Day(); public static const THURSDAY:Day = new Day(); public static const FRIDAY:D...

Resizable Button with background in flash CS4

Hi, I want to create a button which resize dynamically with content. to achieve this, I created a MovieClip in library and added four layers into it namely - text, bg, shadow and border. Problem I'm having is, if I make textfield autosize, only textfield resizes and others stuff remain as it is. if I calculate width required using xxxL...