actionscript-3

Im getting a data binding error when trying to embed flash into Flex 3

My script is: [Bindable] [Embed(source="loader.swf")] public static var Icon:Class; and my mx is: <mx:Image source="{Icon}" y="125" x="0"/> It works but when I try to export it it won't because of: Data binding will not be able to detect assignments to "Icon" What am I doing wrong? ...

AS3: creating a class with multiple and optional parameters?

I'm creating a slideshow where each slide can have: - a video or a still - 1 audio track or many (up to 3) - 1 button or many (up to 3) I was thinking that each slide can be it's own object, and then I would pass the video, audio, buttons, etc., into it as parameters: package { import flash.media.Video; public class Section ...

3d flipping/rotation in flex-actionscript 3

I want to make an flipping card object which has three sides, basic requirement is like below as in image, I want to rotate from horizontal center of card but I can not find any way to change orientation of rotation except put card in an container and set its x to -(width/2) I am using appendRotation method after setting its z compone...

instantiate sound clips dynamically in as3

How can i call and instantiate soundclips in my library dynamically here is the code i have so far function soundbutton_Handler (e:MouseEvent):void { trace(e.target.name); var mySound:Sound = new e.target(); mySound.play(); } and the error i get is : Error #1007: Instantiation attempted on a non-constructor. at quiz_fla::MainTimeli...

Passing an ActionScript JPG Byte Array to Javscript (and eventually to PHP)

Our web application has a feature which uses Flash (AS3) to take photos using the user's web cam, then passes the resulting byte array to PHP where it is reconstructed and saved on the server. However, we need to be able to take this web application offline, and we have chosen Gears to do so. The user takes the app offline, performs his...

Take advantage of Flash CS4's PNG Compression, but as an external file?

Hi folks! Here's the issue: I'm developing some Flash web sites and really enjoying AS3. The problem: PNG 24-bit images are too big... I have three PNG images with transparency that I'd like to rotate through on the "Home page" every 10 seconds or so. Great. No problem - but instead of embedding all three PNGs in the SWF, which wo...

How do I retrieve twitter xml for Flash site via php properly

Am I using TwitterScript to retrieve Twitter data for inside a Flash site. Due to Twitter's crossdomain policy, I need to setup a php proxy... Firstly I made a simple one <?php $url = $_GET['url']; readfile($url); ?> but I then get this error URL file-access is disabled in the server configuration which is only resolved by getting...

Flex 3: Possible to add a Context Menu to a ItemRenderer inside a DataGrid?

I have an ItemRenderer that is shared by several applications (inside a DataGrid), and I would like to add a context menu to it (rather than in each application). The renderer is derived from the Canvas class, and the code to create the context menu looks something like: var menuItem:ContextMenuItem = new ContextMenuItem("Te...

Dynamic text within one UILoader in ActionScript-3.

I want to show some dynamic text and that is read from a php file within xml. Here in swf player i just set three button. Two button for text and one button for images. This all are working fine but the swf background covered by the white background. Here is the normal view and some of this code snippet normal view image Code : btnI...

A* algorithm works OK, but not perfectly. What's wrong?

This is my grid of nodes: I'm moving an object around on it using the A* pathfinding algorithm. It generally works OK, but it sometimes acts wrongly: When moving from 3 to 1, it correctly goes via 2. When going from 1 to 3 however, it goes via 4. When moving between 3 and 5, it goes via 4 in either direction instead of the shorter w...

ActionScript lineStyle Thickness to fill a circle

i'm trying to build a circle using lines. each line starts in the centre of the circle and is as long as the circle's radius. using a loop along with sine and cosign waves, i can build the circle using the sine and cosign to mark the coordinates of the lineTo parameter. my problem is with the line thickness parameter of lineStyle. i ...

DisplayObject not being displayed in AS3

I have this class: public class IskwabolText extends Sprite { private var _tf:TextField; private var _tfmt:TextFormat; private var _size:Number; private var _text:String; public function IskwabolText(params:Object) { var defaultParams:Object = { color: 0x000000, background: false, ...

Flash CS4/AS3 Writing local file from local game without save dialog prompt?

I'm writing a game to be run locally, on the user's computer. NOT over the internet. I want to have a file that will hold the usernames and avatar indices (they're in an array). I want to know if there's a way to write to files through Flash with AS3. I'm using CS4. I'd also like to know if you can delete files through Flash, though t...

Security Policy not working, as3

How to I get my security policy working? My parent swf parses an XML doc and loads 2 children. It throws a 2148 security error, and only works in the Flash IDE. PARENT SWF 'I put it at the top of my code. That seemed like the proper event flow' flash.system.Security.loadPolicyFile("crossdomain.xml"); I've referenced my security file ...

Using Sandy 3D AS3, fill the viewport (exact fit) with multiple 3D objects.

I'm stitching together an image using multiple instances of the sandy.primitive.Box. Each box is 96x91 while the viewport is 960x273 which should make for an exact fit if I layout the boxes in a perfect grid of 10x3. However, I can't seem to get the exact camera fieldOfView. I've tried a couple formulas (one for adjusting the "focal leng...

Am I doing AS3 reference cleanup correctly?

In one frame of my fla file (let's call it frame 2), I load a few xml files, then send that data into a class that is initialized in that frame, this class creates a few timers and listeners. Then when this class is done doing it's work. I call a dispatchEvent and move to frame 3. This frame does some things as well, it's initialized a...

Flex bar chart with Two Y axis

I am trying to create a bar char in action 3 script. But for some reason I am getting 2 y-axis and no x axis. Can some one help spot the error. I have said "placement " bottom. The chart creation method is "getBarChartData", this method when invoked creates a barchart and adds it to a canvas. This section is visible completely and ca...

How to determine if application is ran on 64 bit OS? (Adobe AIR )

How to determine if an application (e.g. Adobe AIR) is running on a 64-bit OS? What function could one use to check this? (Code sample, please.) I found one simple solution... Are there any others? ...

Adobe Air how to check if folder exists?

Adobe Air (2.0) how to check if folder exists? (like folder C:\Program Files (x86) on windows) (code example needed, please) ...

Actionscript 3.0 Play and pause add effect.

layer 1 --> an embeded video layer 2 --> an invisible button **Here is my code in layer 3** stop(); var vid:Boolean = true; function vid_event(event:MouseEvent) { if (vid) { stop(); event.target.gotoAndStop('pause'); vid = false; } else { play(); event.target.gotoAndStop('play'); ...