actionscript-3

External Interface not returning a variable which is a url generated from XML data...

Hi all, Here's the problem: Basically I have some XML generated data which I'm pulling into flash. I'm using an ExternalInterface.call to export out some data to JavaScript in an Array. For some reason everything EXCEPT the url is getting returned - I've tried to trace the url - works fine. I've set a variable with a standard url in the...

flash as3 children of Image or UIComponent not displayed

Hi everybody ! For instance the mx.controls.Image objects are only displayed when i add them directly to the main application object. If i add a "subimage" to the previously created Image object it simply doesnt show. Why ? What concept did i miss ? What I want to do: var img : Image = new Image; var subimg : Image = new Image; img.s...

Static class keeps throwing "Error #1063: Argument count mismatch"

I've created a static class in Flash which works as the inventory delegate for this game. Flash though keeps giving me this error: ArgumentError: Error #1063: Argument count mismatch on Inventory(). Expected 1, got 0. at flash.display::Sprite/constructChildren() at flash.display::Sprite() at flash.display::MovieClip(...

flex air app - Get User's AD domain

Hi, Using Flex 4 / Air 2.0.3 Is it possible to get the active directory domain name associated with the logged on user? This page (http://stackoverflow.com/questions/1376/get-the-current-logged-in-os-user-in-adobe-air) shows the user name can be inferred from the user directory folder name, however is there a way to get the domain nam...

AS3 Inheritance : load or init event ?

Let's assume we have the following class : public class ImageButton extends MovieClip { private var bmpNormal:BitmapData; // ------- Properties ------- public function get BmpNormal():BitmapData { return bmpNormal; } public function set BmpNormal(value:BitmapData):void { bmpNormal = value; } public function I...

Flex vs ActionScript

Hi all, I'm trying to build/implement a Flash video player to play videos. I have looked at Flex and built a basic application with just a VideoElement. It gets compiled to 41k without statically linking the libs and 300k with linking the libs. I generated the report but am still not sure why I would need all those components just to bui...

ActionScript and Timeline

Hi all, I am facing a problem that I have a hard time understanding. I am currently working on a project that involves dropping objects (scrabble letters) onto different cells in a table. My project also involved multiple levels. My layout is rather basic. I have a a bunch of tiles (25 letters) above a 2-columns table (left side for d...

Saving a change to attributes in a pre-existing XML file using AS3

So here's the situation: I have an XML file that is holding a short list of nodes, all of which have two attributes associated with name and a score. This file is already loaded into flash and creates a high-score table, of sorts. Now, what I want to do is to be able to grab data collected in the application, use that to change some at...

Is it possible to export all movie clips as images from actionscript?

You can manually save some particular movie clip on a stage as an image by running "Export > Export Image". Is it possible to write an actionscript that would export all movie clips on a stage to images automatically? Or at least is there a way to automate this in any way? ...

Best practice for interface with a getter function that could return multiple types

I have several data manipulation widgets that all implement a custom IPropertyEditor interface. I would like to include a GetValue getter, but the return types could be String, Boolean or int, off the top of my head. In AS3, all of that inherits from Object, so I could have GetValue return an object, but I don't feel great about that app...

Transfer PHP session to flash

Hello, we developed an internet application for company purposes a while back (company and friends, to be precise :]) and now we're trying transfer PHP session to loaded Flash, so flash can identify itself as being loaded with user profile (stored in MySQL, accessed only by PHP so far) when communicating with server (either FMS or Wowza...

How to rotate an isometic view?

I'm creating a view of isometric tiles using this simple nested loop: const TILE_WIDTH:Number = 180; const TILE_HEIGHT:Number = 90; for( var i:Number = 0; i < 10; i++ ){ for( var j:Number = 0; j < 10; j++ ){ var tile:MovieClip = new TileMC(); // a movieclip in the library... // with a different tile & label on each...

Why this rect is not drawn?

My actionscript: package { import flash.display.Graphics; import flash.display.Sprite; import flash.events.Event; import spark.core.SpriteVisualElement; public class SimpleFill extends SpriteVisualElement { public function SimpleFill() { //var sprite:Sprite = new Sprite(); ...

How to include external actionscript library into flash?

Sorry for the dumb question, but I've spent already hours trying to figure this out (I am not a flash developer). I have downloaded some external actionscript library in a form of a bunch of folders with .as files that have the following folder structure: com/helper_lib1/*.as com/helper_lib2/*.as com/primary_lib/LibClass.as <- primar...

TextField and Security Sandbox Violation

Hi I am creating a TextField in my flash application, but when i am starting to write something the following error in written to trace: * Security Sandbox Violation * SecurityDomain xxx tried to access incompatible context yyy What is the reason for that? How can i solve it? ...

AS3 Embedding assets - "Warning: Failed to parse corrupt data"

I've got an AS3 project where I'm trying to compile in several images, a soundtrack, and a video via [Embed] metadata. It's a product requirement that these be embedded, so network transfer is not an option. I'm getting some really strange behavior - a sort of intermittent corruption of the compiled-in data. Sometimes after the proje...

Finding A Child Control Based On X & Y Coordinate in ActionScript

In Flex/Actionscript When writing an on mouseMove event on a Canvas control for example, how could I check to see what control if any is under the mouse pointer at a particular coordinate? ...

Filling Flex Application background with pattern?

We are trying to fill our Flex 3 applications background with an image pattern by repeating the pattern throughout the background. The pattern is a very small "bulleted"-background. The Flex App seems to just stretch the image pattern even though we've specified in the CSS the following: Application { background-gradient-colors: #...

How to get name of MovieClip on Flash stage that was created dynamically?

There are multiple MovieClips that will be dynamically placed on stage. These MovieClips are coded to be buttons. I'm trying to figure out--when a user clicks on the MovieClip...figure out which object on the flash stage the user clicked on. Inside function toggleClick I put the trace statement: trace("movieClip Instance Name = " + e....

Passing parameters to a function reference?

Hey all, I'm attempting to write a performance testing function that can take any function, run it X times and spit out how long it took that function to run in AS3. I've got it working just fine if a function doesn't take any parameters but it comes up with an error otherwise. Here's the code: public static function testFunction(tar...