actionscript-3

Filtering out all but a specific color of an image in Flex

Let's say I have an Image in Flex, and I want to filter it such that only the Green Pixels are visible... For example this image: Would show up on the screen as: How can I accomplish this in Actionscript/Flex? ...

Flash event dispatch question...

Hi guys.. I have a question about the event dispatch. I am trying to write the code for youtube player and find the following link.. http://www.codingcolor.com/as3/as3-youtube-chromless-api/ He has many dispatchEvent call similar like this: dispatchEvent(new YouTubeEvent(YouTubeEvent.ON_IOERROR,event)); For my understanding, cus...

Detect position?

Hi, I'm trying to create a simple game with a boat moving between left and right by the keys. The moving is OK, but when I try to detect the left och right end it doesn't work at all. Below is a part of the code. What could be wrong? stage.addEventListener(Event.ENTER_FRAME,moveBoat); function moveBoat(event:Event):void { if(! ...

getting the accurate time for every mousePressed event

When someone clicks in my flash activity, sometimes it triggers a lot of computation. If the user clicks again (e.g. a double click), this event gets queued and dispatched after the heavy computation is complete. If I clicked many times, the problem is just compounded -- if clicked fast enough, the queued heavy computation finishes up ...

Flex: type was not found or was not a compile-time constant: Button

Hi guys.. I am trying to build a pure as3 project in flex and I got the following error: type was not found or was not a compile-time constant: Button type was not found or was not a compile-time constant: TextField My code is: import fl.controls.TextInput; // import my textinput import flash.display.Shape; import flash.dis...

Can not add font to dynamic text field.

I am Tring to Add Font in my dynamic text field But it just dont happens here is the code var format:TextFormat = new TextFormat(); format.color = stringColor; format.font="Palentino linotype"; mysidepanel.badgeHolder.defaultbg.usernameholder.engraveUsername.setTextFormat(format); mysidepanel.badgeHolder.defaultbg.de...

Indexing Array, Non-Null Error AS3

Hello, This picture gallery adds children. It does what it needs to, but throws a #2007 error. There's a garbage and range issue I want to fix. Is there an easy solution for this? Thanks, //PICTURE GALLERY var um0:MovieClip = new z0; var um1:MovieClip = new z1; var um2:MovieClip = new z2; var um3:MovieClip = new z3; var AR:Array = [um...

In Flash, how do I import a package, instantiate the class, and call a method without getting an error?!

This is driving me absolutely nuts. I've scoured threads on the subject and NOTHING seems to work. I have an FLA file with the following code on frame 1: import TestClass; var tstClass:TestClass = new TestClass; tstClass.testMethod(); In the accompanying AS file, I have the following: package { public class TestClass { ...

System.setClipboard() inside event handler

Any thoughts on a good way to accomplish something along the lines of var request:URLRequest = new URLRequest("http://myurl.com"); var loader:URLLoader = new URLLoader(); loader.addEventListener(Event.COMPLETE, function(event:Event):void { System.setClipboard(loader.data); }); in actionscript 3? It seems as if System.setClipboard() ...

Actionscript: working with the audio / video of FLV

Hi, I'm wondering if what I want to do is even possible with flash. If I import an FLV video is there any way to remove the audio, put the audio into a byte array, and then re-add the audio to the flv video? Thanks for any advice on where to start! ...

Flex Event Dispatcher Questions......

Hi guys... I am trying to dispatch an custom YouTubeEvent from my Player.as and wish my Main.as would listen and create the video player...Apparently my eventHandler can't catch the event to create the videoplayer.......My flex debug mode is so screw up I can't even use it...My code is as follow..I really appreciate any reply or help....

Adobe Flash Professional - runtime error line number?

Compiled error show the line number well, but how about runtime line number? I often get error such as: ArgumentError: Error #1063: Argument count mismatch on cards::Game/myfunction(). Expected 0, got 1 and if I have many myfunction() in my AS3. It would be frustrating if I have to check one by one. Isn't a line number would...

How to guess maximum possible outgoing bitrate for a NetStream with RTMFP for Flash?

Hi there, I've setup a sending NetStream connection in Actionscript 3 for Flash. I would like to automatically select the highest possible encoding quality for transmission. To do so, I need to get the approximate possible outgoing bitrate (the "upload" speed) and then choose the corresponding quality. My question is, how do I approxi...

pass a string statement from a class, AS3

Hi, I want a way to pass a string statement from one base class to an other. The two classes are CLICK and READ. What's an easy way to do this? I haven't worked in classes that often to know some of the simple tricks. I appreaciate your help. Thanks, Class: CLICK Base Class: ClickClass Object I've turned in to a base class and placed in...

Regexp to get domain from URL

Anyone knows the Regexp for AS3 to get the domain name from URL? E.g: "http://www.google.com/translate" will get "http://www.google.com" ...

Simple AddChild question....

Hi guys.. I am checking this guy's code... http://www.codingcolor.com/as3/as3-youtube-chromless-api/ I have download the source code...but I couldn't figure out how he add the play, pause and stop button in the stage. I know in his VideoPlayerControl.as, he has playbackControl = new PlayPauseButton(); playbackControl.addEventListene...

Change stage background color in AS3?

Hi guys... I am using pure AS3 to build my project. I was wondering if there are anyways to change the stage background color through AS3...Thanks for the help.... ...

Flex/Flash Event Question..

Hi guys.. I am trying to get the event data in a event handler..my debugger image is as follow: I tried to dispatch my custom event with the event.data please see onPlayerError function... My debug shows my data value is -1 but the compile said "access of undefined property data throught a reference with a static type flash.events....

Can I somehow use CS4 to build an AS2 project that uses the new FLVPlayback component?

We have a huge project written in AS2 with the old FLVPlayback component which was responsible for progressive download playback of FLVs. I'd like to support MP4 files (which is now supported in Flash 9 and up with the updated FLVPlayback) but would like to not have to rewrite all of the project. I've seen in various posts on SO surmis...

flex expand and collapse icon in Tree control

I am having some trouble with the flex Tree control. I have a control in my system and of course it is data driven. I have a group which shows a folder icon and that's fine but it also shows an expand icon when the item has no children. I don't what it to show the expand icon when the group has no children but I do want to show the fol...