actionscript-3

AS3 XML, nodeName with attributes comes up blank

I've tried many different ways of accessing the name of an attribute, but just can't get it working. The current Function: protected function applyProperties(_axml:XML):void { var list:XMLList = _axml.properties; var list2:XMLList = list.attributes(); for( var i = 0; i < list2.length(); i++ ){ trace(list2[i].nodeName.toStr...

Best practices for blitting in flash as3

I am creating a blit game and as of right now, the only thing that is blitting is the world itself (i.e. roads, fences). i was planning on displaying my character as a sprite and any interactive objects that it comes by as sprites as well. PickUps, Houses, Enemies. I was wanting to know what are the best practices when it comes to this. ...

Can I put an Image(s) on a Canvas and have them be moved around by the mouse?

I want to dynamically create and put some Image (mx.controls.Image) objects on a Canvas and I want them then to be able to be repositioned by the user via the mouse. Can this be done? Note, I am not looking for drag and drop. I just want to change the X and Y coordinates of Images with the mouse. Thanks! ...

Loading a class in module1 with the same name as a class in module2

I have a Flex application that can load modules as necessary. When the first module is loaded, it creates a class MyBackground(), which paints the background red. When I choose to load a second module (and unload the first) I again load a class MyBackground (from the second module). However, when I step into the constructor for MyBackgro...

How do I get the width and height of an image?

I'm constructing a book of sorts in Actionscript 3 (FlexBuilder) and am trying to size an image dynamically according to the dimensions of it's source file. But, I've found that if I don't explicitly state the width and height of an image, they trace as 0. So that I can scale down an image to fit within a given space, how do I get th...

AS3: call a static class method - class and method names are strings

Hi, I have an ugly problem. I have two string variables (className and staticMethod) store the name of a class and it's static method I have to call: package { import flash.display.Sprite; import flash.utils.getDefinitionByName; import flash.utils.getQualifiedClassName; public class ClassPlay extends Sprite { public function Cl...

Soft scroll with ActionScript 3.0

Hi friends! I'm a noob trying to develop my first site with Flash. I made some scrollers, but they aren't smooth... The code I used was: const scrollUpper:int = -151; const scrollLower:int = 366; const scrollRange:int = scrollLower - scrollUpper; var dragBounds:Rectangle = new Rectangle(scroller_mc.x, scrollUpper, 0, scrollRange); var...

Flash optimisation confusion

Hi, I'm new to Actionscript (v3), 20 years C++ though, and I'm just trying to get my head around some of the performance caveats I'm reading. I checked out this site: http://www.nbilyk.com/optimizing-actionscript-3 and was scared to death of the 'code' section saying that Actionscript has to do a dynamic lookup when trying find stati...

understanding Array::splice in as3

I am trying to remove an object from an array. but from some reason its not working. I am under the impression that a splice accepts 2 parameters. the position of the array. and for parameter 2 , how many to delete from then on out I just want to delete one array so I am doing this array.splice(i,0); but it isn't working. can someone...

Q:recommendations for Actionscript Twitter api library?

Hi New to the Twitter API, but need to choose between 3 different Actionscript libraries available for the Twitter API. Has anyone used either TwitterScript, SWX Twitter, or Tweetr and knows some of the pros and cons of each? ...

Actionscript 3: Check an array for a match

If you have an array with six numbers, say: public var check:Array = new Array[10,12,5,11,9,4]; or public var check:Array = new Array[10,10,5,11,9,4]; How do you check for a match (of a pair?) ...

FLEX: getting a folder size

Hello guys, I'm triying to get a folder size by doing: var FolderFile:File = new File("file:///SomePath/Folder"); var FolderSize: FolderFile.size; But this gives me a value of 0, how can I get the folder size? is there anyway to do this? Tranks ...

null an object kill reference or the space in memory

This might be a dumb question. I think I already know the answer, just clarify. If you declare a object in varible1 and then pass the value into varible2. If you decide to null varible2 would that kill just the reference or the object itself as well. I want to say no, but then again, everything you do to the reference it self, also affec...

Flash As3 Window resize issue.

hi I have a flash script, i added one move clip via addChild, my movie area is 500x400 and the movieClip i aligned to center. But when am trying to set the size with in browser its not aligned to center. all my calculations are getting wrong. package { import flash.display.*; import flash.display.Stage; import flash.geom.*; ...

Why is stage undefined in my Actionscript 3 class even though I've imported the Stage class?

package { import flash.display.Stage; public class MyGlobal { public static var CX:Number = stage.stageWidth / 2; public static var CY:Number = stage.stageHeight / 2; } } The Error is "1120: Access of undefined property stage." WHY? ...

Get current frame in actionscript. What instance should I refer to?

Hi I'm new to actionscript. I'm trying to make a menusystem that will jump to specific frames depending on what frame I'm currently on. I have made a switch/case to evaluate the current frame. I have managed to find this code to get the current frame but I need an instance of my entire flash movie it seems? I have tried this (psudo code...

Flex AlivePDF export charts. Charts being clipped.

I am trying to use AlivePDF to save a chart into a .pdf file. However, when I try to save my chart, it ends up clipping half of the chart in the pdf so it isn't even fully visible. It seems that the screencapture that AlivePDF took to generate my pdf was too small. I am trying to get a chart from a sample to work with sample code for ...

Passing Informaton for Files with Loader

I'm using Loader to get the image data out of a ByteArray. The problem is that I need to store that image data with a name (which is known beforehand) once it's passed to the complete handler. Since the operation is asynchronous, I can't be sure which image of multiple will finish loading first, so it seems I need to pass the information...

Animating glow filter in flash actionscript 3

I'm trying to apply/remove a glow filter to a movie clip on a MOUSE_OVER/MOUSE_OUT event. Basically when I hover over a movie clip I want the glow to animate on, and then animate back off when I mouse out. How would I achieve this? Thanks ...

How to implement google-maps-like zoom-and-pan system in web?

Hello, I'm writing a ticket-shop-system atm for reserving tickets for various concerts. What I have is a php-backend and a webpage that shows a .swf with some actionsscript-3 code in it, to draw in flash some sort of map and make available seats clickable for the end-user. The problem with this solution is, that there are quite large hal...