actionscript-3

Coordinates in distorted grid

I have a grid in a 2D system like the one in the before image where all points A,B,C,D,A',B',C',D' are given (meaning I know the respective x- and y-coordinates). I need to calculate the x- and y-coordinates of A(new), B(new), C(new) and D(new) when the grid is distorted (so that A' is moved to A'(new), B' is moved to B'(new), C' is mov...

flash AS3 - loading image from external domain problem

Hi, I have to load xml from external domain , so my code looks like this... var loader:URLLoader = new URLLoader(); configureListeners(loader); var request:URLRequest = new URLRequest("http://demo.softsolutions4u.com/ss4uplayer/modules/podcast/lib/PlayerAPI.php"); try { loader.load(request); ...

Trouble managing events in Flex/actionscript

Hello all, I'm doing some newbie tests, so I decided to capture the keyboard events to move a rectangle. But I don't get the desired result. Unless I click on the TextArea box, I'm not able to capture the event key code. After that, all goes pretty well. I'm using Eclipse 3.3 + Flex 3.0 on Linux. Here's my code: <?xml version="1.0" e...

AS3 Demo cant make it work

Hi guys, Im trying to use this example code from: http://www.michelvandersteege.nl/blog/archives/266 function splitRGB(img:DisplayObjectContainer):Object { var bmd:BitmapData = new BitmapData(img.width, img.height); bmd.draw(img); var r:BitmapData = new BitmapData(bmd.width, bmd.height, true, 0xFF000000); var g:BitmapData = new...

Action Script 3 / Flex builder 3 : How to make a diagram.

Hi, I want to make a diagram with either flash CS4 or flex builder 3, don't know with one would be the best for the job. More about the task: I want to send in values external to the swf file. The swf-file takes the vaules and makes a diagram of it using x and y values. Any advise or tips of where i can make this is much appreciated!...

Loading a symbol of type Graphic from library with Actionscript 3

Inside Flash, I have a symbol with type graphic in my library and I want to add it to stage using Actionscript 3. Is this possible? Flash does not let me set any Linkage Properties for Graphic symbols. How do I draw stuff in Flash and be able to create multiple instances of that stuff at run time without using MovieClip? Thanks. ...

FileReference.browse() stops playback on some Flash Players

We have an issue were the server session associated with a Flex client times out when the browse file dialog is open for a time longer then the configured session timeout. It seems that on some players, the playback is stopped when browse or download on a FileReference is executing. This also causes remote calls to be blocked and hence o...

AS3 Random repeat x seconds function

Hi, I have the following function: function update(e:Event):void { var val:Number = Math.random() * 120; rgb.r.x = rgb.r.y = val; rgb.b.x = rgb.b.y = -val; } And im looping it with: stage.addEventListener(Event.ENTER_FRAME, update); But what I need to do would be something like: Random number between 1 and 20 If the number is > 1...

Not getting stage.stageWidth and stageHeight on Firefox 3.5

Here's a problem that I've been tried to figure out but still couldn't get the right method to fix it yet. I'm having issue regarding the display when using Firefox 3.5 on MAC, I can see my menu and the display is correct. The menu just position above what it supposed to be positioned. It works fine with Safari on MACOSX. My flash size ...

Properly trimming PCM data from a ByteArray

I have a situation where I need to trim a small amount of audio from the beginning of a recorded clip (generally somewhere between 110-150ms, it is an inconsistent amount). I'm recording in 44100 frequency and 16 bitrate. This is the code I'm using: public function get trimmedData():ByteArray { var ba:ByteArray = new ByteArray(...

Pass easing function as variable in AS3

Hi, I've been looking for some time now.. Is is possible to pass easing function as variable in AS3? eg. TweenLite.to(mcDelimiter, resizeTween, { x:(stageWidthHalf-(initStageWidthHalf-mcDelimiteri_X)), ease:Elastic.easeOut } ); TweenLite.to(mcBody, resizeTween, { x:(stageWidthHalf-(initStageWidthHalf-mcBody_X)), ease:Elastic.easeOu...

Actionscript: How Can I Know When The Source Property Of An Image Is Completely Updated

var I:Image=new Image(); I.source='C:\\Abc.png'; var H:int=I.height; H is always Zero! I am presuming this is because the image hasn't finished reading the png file off the disk yet. What event can I monitor to know when it's width and height will have the right values? The 'Complete' event only seems to work for DOWNLOADED images. ...

Flash to PHP base64 encode/decode

I'm using AS3 to base64 encode a JPG and pass it to Javascript. I'm attempting to use AJAX to pass that base64 encoded string to PHP and have PHP decode it. (I know I could send it back to Flash and Flash could decode it and send it to PHP, but I'm trying to eliminate the need for Flash on the decoding end). It appears that AS3's encode...

flash as3, fade in/out layering problem

Ok, what im trying to do is make a day to night cycle behind my landscape. There is a sun and a moon, they rotate in a circle on opposite sides. (i.e. the sun is up when the moon is down and vice versa) when the sun is coming up it should fade from the night movieclip to the dawn movieclip, then when the sun is up a little bit more, fade...

How to open multiple pop up browser windows from ActionScript?

How to open multiple pop up browser windows from ActionScript? ...

HOw to add combobox/dropdownbox in Action script 3 in FLEX

I have searched a lot but could found a code where i can add comobox on screen CAn anyone give me example . like Var combobox = new Combobox(); i don't have any gui Where can i get the list/attributes of all the components like API for use in AS3 ...

AS3: FileReference ...

Let's say a user is starting to upload a file to the server via FileReference. What happens to that temporary file if the user cancels the upload or closes the browser? At what point is the server script called? Is the server script (in my case, ColdFusion) called only once the file has been successfully put on the server? I'm trying to...

How to protect a form HTML/PHP with JS callback to AS3

Hi guys, I'm developing a Flash website (as3) where I need to be able to upload directly to YouTube by using the DATA API. However in order to do so, I had to use a proper HTML form on top of my flash object. Why? Because of the Browser Based Upload restictions. I first hide the form using JQuery and with a little CSS the form is di...

Convert methods from Java-actionscript to ObjectiveC

Hi I'm tring to convert the following 3 methods from java-actionscript to Objective C. Part of my confusion I think is not knowing what Number types, primitives I should be using. ie in actionscript you have only Number, int, and uint. These are the 3 functions I am trying to convert public function normalize(value:Number, minimum:Num...

Is there any fl.control class exists in flex AS3

Internet says to add import fl.controls.Combobox But FLex says that there is no class called fl.controls which is the equivalent class in flex ...