actionscript-3

Flex 3, cannot convert SystemManager to SystemManager when loading from server?

I am working on an AIR application that needs to load, run, and access methods on a swf pulled in from the net. Using moduals has worked well in the past but due to design constraints is not possible for this application. Below you can see the code where I load the ImageTest.swf then call function Bleh() on it. private var l:Loader = ...

Why do singletons pervade ActionScript culture?

I have recently started doing some ActionScript/Flex programming and I am... Surprised... By the number of singletons I see. They are everywhere! The standard library, the frameworks... Heck, I even read a blog post this morning where the author mentioned that he refactored some of his classes INTO singletons! Is there any reasonable ex...

Keyboard input using ActionScript 3

I am learning how to use Flash using CS4, and focusing mainly on ActionScript3 (since I come from a coding background and not a designer background). I want to respond to the user pressing keys on the keyboard. I have used the official example source at the Flash reference site and followed the CS4 instructions for classes. However,...

is there a way to format actionscript in flashdevelop?

is there a way to format/beautify actionscript (as3) in flashdevelop? if not are there easy ways to do this without using the Flash IDE. Thanks, Josh ...

Flex vertical sliding thumbnails

Hi All, Is it possible to construct an vertical sliding thumbnails of images. The example is shown at following path: http://www.rburman.com/#a=0&at=0&mi=2&pt=1&pi=10000&s=1&p=0 As i am new to flex Please suggest the solution or refer to any example with the source code. Please help. Thanks in Advance. ...

how to maintain ASP session during navigateToURL (safari issue!)

I have the following AS3 code that requires asp.net SESSION cookies remain intact, now it seems that SAFARI does not keep cookies well. (all other browsers are OK). I have cookie based sessions at the moment, question is how to alter the following code to support COOKIELESS sessions in case it works better? var request:URLRequest ...

Flex Databound List with ItemRender - Reorder resets CheckBox Values

Hi I have a Flex List which is databound to a Array. My problem is that when I reorder the List using the built in dragMoveEnabled, the values are reset to the original values. I assume I need to somehow do a two-way databinding but I am not sure how. <mx:List width="100%" top="20" id="uiItemList" dragMoveEnabled="true" bottom="0...

In Flex 3 Using a List Component

How do I have one a background image for each list object and a different background image on rollover. ...

Extraneous text padding in Flash

It seems that flash.text.TextField in Flash has some built-in padding. In particular, my problem is that I need to left-align a text with some other graphical elements, and there is visible (about 3px) offset. The class flash.text.TextField (or any other related text class) does not seem to have property which could change it. I know th...

Why can't typed optional arguments have a default of Null?

In ActionScript 3, when you declare an optional argument by giving it a default value, the value null cannot be used on typed arguments. function Action(Param:int=null){ // 1184: Incompatible default value of type Null where int is expected. } function Action(Param:int=0){ // No compiler errors } Any workarounds for this, or g...

Mapping ActionScript Objects to Classes?

If I've got a bunch of plain old Objects, what's the best way to map them to a bunch of Classes? For example, if I use an HTTPService to pull in some JSON, then deserialize it, I'll have a bunch of objects which look like: { type: "person", id: 42, name: "David" } And I want to turn them into instances of a Person class: class P...

How to getDefinitionByName of a packageless class in AS3?

Say you have a flexunit test that looks like this: package foo { import flexunit.framework.TestCase; import flash.utils.getDefinitionByName; import flash.utils.getQualifiedSuperclassName; class DescribeTypeTest { public function testDescribeInnerType():void { var currentInstance:ChildBar = new ChildBar(); ...

Is there an easy way to find orphan classes in a Flex/ActionScript project?

I have been in the process of creating a "lite" version of an existing Flex application, and thereby porting many of the classes that are used by both into a library project. As such, I want to easily find all of the "orphan" classes in the original project - those classes that are no longer referenced/used by the project. Is there an Ec...

compile a swc in flash for use in flex, with a class written in flex

OK, It sounds complicated, but it's not. Here goes: I want to use some assets ( buttons, etc. ) I'm creating in flash in a flex actionscript project. Since all my assets are bellow 10K, I'm not planning to load a swf ,wait until it's loaded and create the interface. I want to use a swc and just instance the clips I need. Also, I want my...

Graphical representation of data in flex

Hi, I am a newbie in flex. Latest task is to generate a graph or a netwrok based on the data input. What is the best way to do it. Also when clicked on a node of a network it should show the associated data with that node. Hope to get some help soon! Thanks, Kartik ...

Setting PHP session variables using Flash Actionscript

Hello all, I have a simple PHP upload script that is called from my Flash App. I am sure it makes the call because it actually uploads the file! session_start(); $default_path = 'files/'; $target_path = ($_POST['dir']) ? $_POST['dir'] : $default_path; if(!file_exists($target_path)) mkdir($target_path, 0777, true); $destination = $t...

Loading a SWF into an ActionScript 3 project (Flex Builder)

We're developing a small Flash gamelet for an European client of ours, who require us to develop our Flash game in such fashion that they can load our SWF game into their ActionScript 3 project, dynamically. Basically they have a console that will load many other Flash games, amongst our own, depending on which button the player presses...

[Flash/Papervision3D] DisplayBoject3D's axis aligned bounding box, and why geometry is null?

I am trying to retreive the 2D bounding box for a 3D plane I have on stage. With some research I figured out I should be looking for: plane.geometry.aabb But the plane, added on stage and such has null for its geometry? - what am I doing wrong here? I am able to calculateScreenCoords and get screen.x, screen.y. But it would save my day...

FLVPlayback fullscreen button not working

In my flash video using FLVPlayback, clicking the fullscreen button doesn't do anything, either in the html-loaded version or (more troublingly) when running locally. I've set "allowFullscreen" to true in the object and the embed tags in the html version. There are no errors in the flash console when running locally. Example. Any ide...

For VS Foreach on Array performance (in AS3/Flex)

Which one is faster? Why? var messages:Array = [.....] // 1 - for var len:int = messages.length; for (var i:int = 0; i < len; i++) { var o:Object = messages[i]; // ... } // 2 - foreach for each (var o:Object in messages) { // ... } ...