actionscript

How do nested tags work in E4X?

Suppose I have the following XML: var foo:XML = <root><a>this is a <b>special</b> case</a></root> Is there any way to detect the position of <b> relative to the contents of <a> without a custom subparser? ...

Have you used SWF Protector? Flash Protection

Im seeking for some reliable flash obfuscator. Price is also important for me, so Im thinking to buy SWF Protector Made a few testes and as a result: SWF Protector is the only one that breaks Flash Decompilers. Tested protected swf with Sothink and Trillix Decompilers. Both failed to open protected AS3 code. But before buy it I want to ...

Scaling multiple axes in PlotChart

When I programmatically create a PlotChart starting w/ no series and adding series w/ own scaling and verticalAxes (and Renderers but not necessary for behavior error), the axes and data show, but the default axis controls all scaling and the other axes are erroneous. Thus, the yValue magnitudes do not correspond to their associated axes...

Countdown and lifepoints, as3

Hey How do I get accurate counting? My game has is a pass or fail scenario based on time. I need an equation that will work in ActionScript. Thanks Timed-scenarios: 'Commence escape within 30 sec or lose 600 life points' ...you see only readout of lifepoints, but time needs to be accurate I'm not attached to this, it's just an exampl...

Countdown and Points, AS3

Hello, This all works perfectly, but one thing. How do I count in ones now? Thanks OUTPUT OF LIFE LOSS 580 560 540 520 500 480 460 ect... OUTPUT NEEDS TO BE 600 599 598 597 596 595 ect...'and ending with time left counter if there is no win' SCREENSHOT OF COUNTDOWN ActionScript //Starts with 600 life points, counts from 30-0 //gam...

create an array of words (Strings) from String

How do I create an array of strings from a string, eg. "hello world" would return ["hello", "world"]. This would need to take into account punctuation marks, etc. There's probably a great RegEx solution for this, I'm just not capable of finding it. ...

Ease rotation and position of MovieClip to mouse, math help

Essentially what I'm trying to do is nearly the same as this: http://www.senocular.com/flash/source/?id=0.16 However I'd like to ease/tween the movieclip position and rotation to the mouse position. The main issue I see is trying to get the current movieclip rotation and the target rotation, then tween it cockwise or counterclockwise f...

How can i resize the entire flex app just like acrobat connect?

hi guys. ive been pondering how to create the same type of resizing that acrobat connect does. i did read the documentation of percentage sizing. and i have implemented it. but its not how i want it to look. to see an example : https://admin.na3.acrobat.com/_a204547676/flextras/ sorry Jeffrey to use you as an example. :) just try...

Flash - page flip which allows site users to create their own book

Hi, as the title suggests, I'm looking for a Flash page flipper which I can integrate with an existing database of users and allow them to create their own flash books - I don't need anything complex as this isn't a CSS, just something which allows users to insert images and some text in each page. I've had a look at quite a few now and ...

Passing e:MouseEvent as an argument via setInterval

Hi. So i have this function capture_mc.buttonMode = true; capture_mc.addEventListener(MouseEvent.CLICK,captureImage); function captureImage(e:MouseEvent):void { //lalalala } I want to call this function every 2 seconds (after mouse click event happens). I tried using setInterval setInterval(captureImage,2000,e:MouseEvent); but...

Determining which LineSeries a user clicked on within a LineChart, in Flex 4

I have multiple LineSeries within a LineChart, sort of like this: private var data:ArrayCollection = new ArrayCollection( [ { Time: 1, Bob: 5, Joe: 5, Sarah: 6 }, { Time: 2, Bob: 4, Joe: 6, Sarah: 7 } ]); public function doItemClick(event:ChartItemEvent):void { var hi...

How to import an ActionScript class into a package?

I'm having a bit of trouble getting a class to import. Here is my filesystem: - com - test - class1.as - example - class2.as I'm working on class1.as and want to import class2. How can I do that? The following doesn't seem to work: import com.example.class2; How can I access class2 from class1? ...

how to create a simple animation in pure actionscript (flex sdk only)

I really don't want something sophisticated, in fact I want the simplest animation for learning purpose: I just want to move a shape on a straight line. Is it possible to do so in pure actionscript (with flex sdk only) by creating a timeline programmatically or without creating timeline ? ...

Problems setting alternatingItemColors from CSS style (Flex)

Hopefully simple question: I'm trying to set the alternatingItemColors on a datagrid via some values that I set in a CSS file but nothing seems to work. the CSS file looks something like this: .FACS0 {color: #B0B0B0;} .SACS0 {color: #A6A6A6;} .AICS0 { alternatingItemColors: #B0B0B0, #A6A6A6; } I tried a variety of different th...

Difference Between Class Reference And Class Instance

Given that both of these calls to getQualifiedClassName return the same thing (mx:Label), how would one go about programatically differentiating between an instance of a class and a reference to the class... var lab1:Label=new Label(); var lab2:Class=Label; var qcn1:String=getQualifiedClassName(lab1); var qcn2:String=get...

What's Flash Lite at all?

I've long thought of Flash Lite as something similar to actionscript, for mobile browsers. But today I tried to create a Flash Lite project in flash cs5 but found it seems to be some kind of Flash Player ? Which is the case ? If it's the latter case, is actionscript for Flash Lite the same as actionscript for Flash Player or has some ...

What tools are available for flex code coverage?

I have been trying to get Flex Cover to work correctly for some time but the problem we are encountering is that it only provides code coverage for classes that are currently being hit by our unit tests. How do we get flex cover to provide correct instrumentation for our entire source directory? I have tried several different compiler ...

Flex 3 FileReference not updating when new file is created

I am trying to allow download of a particular file that the user has generated (or will generate). If they try to download the file AFTER generating, the fileReference does not seem to create the new object (it downloads the old file). Code is something like this: private function downloadFile():void { var node:XML = XML(myTree.se...

Flex command line tools into GUI

Hi there - desperately need your help... Specification: ["Our plan is for you to write an application, built with AIR, to drive some command-line tools supplied with the Flex SDK (http://opensource.adobe.com/wiki/display/flexsdk/Flex+SDK). These would make use of AIR 2's NativeProcess API (http://www.adobe.com/devnet/air/flex/quickstart...

Reset IDataInput Stream

I am unsure how I would reset an IDataInput stream when deserializing data in an AIR application. What I am attempting is: public function readExternal(input:IDataInput):void { var file_version:String = null; try { file_version = input.readString(); } catch (e:Error){ //We have an older file type, attempt to parse var...