actionscript-3

Checking if an item exists in Action Script...

Sorry, I've never done AS before, so I apologize for the basic question. There is a line in this file I am trying to modify: var media:Namespace = rssXML.channel.item[i].namespace("media"); I'm just trying to check to see if it exists and if it has a value? I know in PHP it would be if(isset(rssXML.channel.item[i].namespace("media")...

Extracting asset from swf file?

As I am building a Flex framework for minigames, I plan to bundle a bunch of graphic assets (movieclip symbols) into a single swf file, which I will load into my Flex application, before extracting the symbols from the swf file for use in my application. My question is this: how do I do this through actionscript? Thanks! ...

How can an AS3 swf hosting an AS2 swf share the same array?

I have an AS2 swf that has an array that is updated when a user clicks on items on the screen. The array stores the currently selected items. This As2 swf is hosted by an AS3 swf loaded in using Loader class and a local connection between them is managed by swfBridge. I want to know what the best way for both AS3 and AS2 swfs to share ...

Cast JSON as a custom object?

Hello I was wondering if it is possible to cast my JSON string as a custom object? basically : var customObject:CustomObject = JSON.decode(evt.result as String) as CustomObject; Regards Adlertz ...

How can I copy a NetStream Object?

I'm using BulkLoader to load an array of 10 or so FLV files. I want to be able to use and control these FLVs throughout my app independently. So for instance, FLV_1 may be displayed in duplicate but I want to pause one instance and play the other in tandem. I would like to pass the NetStream object around to other Video objects and di...

Can you require a function parameter to be a static constant of the function's Class?

Let's say I have a Custom Event Class, and it has several Event types stored in static Constant: package customEvents { public class { public static const DISAPPEAR_COMPLETELY:String = "disappearCompletely"; public static const SIT_DOWN:String = "sitDown"; public static const STAND_UP:String = "standUp...

Resize Flex/Flash object from the left side?

I'm working on Flex component which can be resized using handles on the right and left (that is, if you click and drag the left side, the component will grow to the left, if you click and drag on the right, it will grow to the right). Right now I am using: var oldX:Number = this.x; this.x = event.stageX + (initial.x - initial.stageX); ...

RegExp in ActionScript 3: How to exclude a complex prefix?

Hi, AS3 RegExp engine (and ECMAScript based JavaScript) do not support complex "lookbehind" expressions. (lookahead expressions are fully supported.) For example: (?<=<body>)(.*?)(?=<\/body>) will work but; (?<=<body\b[^>]*>)(.*?)(?=<\/body>) will not work in AS3. What I need is to match a complex prefix but exclude it in the ...

call function in superclass from subclass

I'm having a small project in Actionscript 3, and everything would be very much easier if it was possible to call code in the superclass from the subclass. This is the project: CarGame         Car is it possible to call a function in the CarGame class from the Car class? ...

Problem With DAE parser augmented Reality

Hi everyone, I tried everything but no success.I am having big problems in importing files.So many error.... spent 5 hours but nothing. I successfully able to create project using collada parser but all the problems are coming when i am using import org.papervision3d.objects.parsers.DAE; There were some files missing and when i tried to ...

How do I get the fullname of a file in Adobe AIR?

I'm using something like this to browse for a file in AIR. I can get the filename, but what I need is the fullname of the file. Is there a way to do that? var file:FileReference = new FileReference(); file.addEventListener(Event.SELECT, selectHandler); file.browse(); private function selectHandler(e:Event):void{ file.removeEventList...

Action Script Prototypes and dynamic function creation

Does anyone know how AS3/Flash runtime handles trying to modify the prototype when working between sandboxes. In particular I create object O in sandbox A, then pass it to SandBox B. What is the effect if code in sandbox B tries to modify the prototype ? (do the objects in A of the same class see this ?). Can Sandbox B overwrite publ...

Flash Whiteboard: Actionscript 3

I'm looking for a flash Actionscript 3 tutorial on how to create a whiteboard application with flash media server 3.5. Please anybody have any ideas where I can start looking for this information? ...

adding a custom event listener in as3

I've done a lot of reading through forum posts and tutorials, but I still can't wrap my brain round events and event listeners. I have a pretty simple example, but I can't get it to work. I have an arrayCollection of custom objects in a repeater, when one of those objects is clicked, I want a different componenet to display data associa...

Javascript and Actionscript 3 [Setting a variable woes]

Okay, so I'm trying to set a variable via a javascript method call. However this is not working. I googled and ended ip going back and trying swLiveConnect, but that's outdated and it turns out my way is now the way to do it. So here's my javascript function and actionscript. I have no idea what's going on, I bow before the more skilled ...

Reading Textfile and split the string and push in to array

HI, I am reading the text file 1=apple 2=jack 3=lemon 4=banana var loader:URLLoader = URLLoader(event.target); var mystring :String = loader.data; tempArray = mystring.split("\n"); and getting the value like 1=apple 2=jack 3=lemon 4=banana i need to split the value and push in to array like..removing the "=" and ...

e4x query based on sub attributes

I'm trying to execute an E4X query (on the xml below) that will return all "accessor" nodes that contain a "metadata" node with a "name" attribute that equals "Required". I tried... type.accessor.(metadata.@name == "Required") ...but that only works for accessor nodes that have only 1 metadata node. Any clues? <type name="org.sprin...

How to convert bytearray to image or image to bytearray ?

How to assign bytearray value to panel background image. If anybody have idea or experiance plz help me to overcome the problem. BRIEF EXP: I have panel control and want to load image getting from webservice as a backgroundimage. So i used setstyle() but its not accepting that image. so how to add that image into my panel background i...

What is the difference between a.x = 100; a.y = 100 and a.move(100,100) ?

Hi, everybody. What is the difference between using a.x = 100; a.y = 100; and a.move(100,100); in actionscript 3 / Flex ? Best regards, Artem ...

flex doesn't seem to bind with custom actionscript object

Hi, I have a custom actionscript object defined as bindable with a number of public properties. [Bindable] public class MyObject extends Object { public var mobileNumber:String; ... In my mxml I have: <mx:Script><![CDATA[ import mx.binding.utils.BindingUtils; import org.test.MyObject; [Bindable] private...