actionscript-3

3d maths in Flash AS3

I'm trying to code a 3d wall like http://www.flashloaded.com/flashcomponents/3dwall/ The shape I am looking to create is like a bath or arena where it is a curve cornered rectangle with sloping sides. The image below shows what i'm trying to achieve if viewed from above. I hope that helps. Can anyone give me some ideas on the maths ...

Set Dynamic Variable name In ActionScript 3.0

I need to set custom variable name for every iteration. Why this isn't possible? for (var i:uint = 0; i < 50; i++) { var ['name' +i] = new Sprite(); } *//1840: Syntax error: expecting identifier before left bracket* ...

Can an overlapping sibling prevent an Event?

Below is the code for a simple Flex actionscript project. A sprite is partially covering a hyperlink. What's happening is that when you hover over the sprite, if you're also hovering over the hyperlink, the hyperlink is activated. I want to prevent that. I want the hyperlink to be activated only when the mouse hovers over it -- but not w...

Is There an Offset Equation for Z Position Change in Actionscript?

Say I have a movie clip that when loaded I set it's .z position to 2000 to make it look far off in the background... How in the world can I set it's x and y points with any certainty as to where it will appear on the stage? Is there an equation? E.g.; original.x = 200; original.y = 200; original.z = 0; new.z = 2000; new.x = original....

childAllowsParent

A simple question, really - but one I've been beating my head against the wall for hours and hours trying to solve: How do you make the childAllowsParent property of an SwfLoader go from false to true, that is, how as a parent application do you set up security to make the child app's events and other properties accessible to you. To r...

Previous array MC position

I'm basically trying to create a tree diagram. I've created the 1st level and I wanted to put it into an array so the next level would be able to get the properties from the previous level/array. But now it seems like I cannot push the circles with its own unique"name" into circlesNewArray. what's the problem here? I'm still not sure i...

How can i give password validation in flex

I want the validator for password text input. At least one Upper case letter At least one numeric character At least one special character such as @, #, $, etc. should be there in password how can i give it in action script or mxml.please help me. Thanks. ...

Play FLV from ByteArray in Flash Player

Hi, I have a flash video file (FLV) stored in the ByteArray object and would like to play this video. Is there any way to achieve it? Maybe using Alchemy? Thank you! ...

Creating a large 2D array and populating it in AS3.

Hi, I was wondering if there was a better way to create a large 2D array and populate it with a single item with AS3? This is a quick example what I'm currently doing: private var array:Array = [[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], ...

Play random sound and match to movie clip quiz AS3, CS4

Hello I am creating a quiz in which the user matches an object (movie clip), to a sound clip that is played. The sounds are stored in an array and a random one is chosen. Then 4 random movie clips are created dynamically which hold the object image. I need a way to link the sound clip to the movie clips to check if the correct one was c...

Error #3119: Database file is currently locked

I have developed to applications in flex. The one application constantly retrieves data from the internet, while the other can be opened and closed when you want, both apps use the same database. The problem is that at random I get an Error #3119: Database file is currently locked. Is it not possible to have two stable connections in a A...

Reset a flex label width to "auto" after setting an explicit width?

Once I've set either the width or percentWidth property on a flex label, is there a way to reset the width to its default (i.e., the width of the text plus padding)? I'm using the label as a renderer. In some cases, I'd like it to automatically size to the text, and in other cases, I'd like it to be a percentage width of its containe...

AS3, loading in a SWF as a custom type

Fundamental question here. Typically in AS3 you load in a SWF via the Loader, and what you get is some sort of pseudo MovieClip that is of type "Loader". Is there any holy way under the sun to cast this loaded SWF to a custom type that extends MovieClip and not Loader, assuming the SWF was published with a base class of the custom type?...

actionscript3 print array value on button rollover

Hello, I have created a flash map of the uk which is splti into regions, each region is a button that is fully visible when not rolled on and and fully transluscent when rolled over(to show the same region in a different color). What I need now is for when the button is rolled over I need it show the region name, I have an array of the ...

Find which AS3 classes are included in a SWF

I have been investigating swfmill and ran it against some of my AS3 SWFs, I get <UnknownTag id="0x52"> <data>...</data> </UnknownTag> and UnknownTag id="0x4C"> <data>...</data> </UnknownTag> These lines are most likely contain the data I am looking for, but the data is unreadable. Does anyone know of another way to f...

Flash/PHP File Upload Speed Issues

I am trying to write a simple, in-house file delivery application for uploading files for easy download on our client's end. I am using Flash with a very basic PHP script receiving the file. So far, this does work. The problem statement is: using FTP, a 100 MB file will upload in 2-3 minutes. Using my simple Flash uploader and uploading...

Optimizing AS3 SWF files for size?

Are there any tips / best practices / secrets for optimizing the size of AS3 SWF files? In particular, any way to get a breakdown of what is taking up space inside the SWF, like you used to be able to in the old Flash 7/8 days? I'm not using the Flash IDE any more, but now I'm using either Flex Builder or FlashDevelop, so it needs to be ...

How to manually set focus in AS3 so mouse wheel works?

(This is a question for Flash 9/10 AS3.) I'm trying to solve a problem where the user has to click on an area before it starts getting mouse wheel events. I assume the focus is set elsewhere so in the ctor for my movieclip that is asking for events, I say "stage.focus = this". This ought to work, judging from the web searches I did. Bu...

AS3: Check if a Dictionary is empty

Flash implements a dictionary (that is, something like a HashMap) using two approaches. One approach is the flash.utils.Dictionary class, and the other is a generic Object. I'd like to check how many key:value pairs are in the dictionary. In most cases I'd simply like to know it there are any key:value pairs, that is, just check if it's ...

How to access MC properties inside an Array

Lets say I have a MC with a x position of 100. And I push it in An array newArray.push(MC) how can I access the array and get MC.x? ...