actionscript-3

Loading swf Problem in Air,Flex3

Hi, I have 2 swf file, one file is loading fine in SWFLoader in Air application but another is not loading, i dont know why its happening. differents between two file :- For ex: Swf1 is Main swf .(it has dependency file like xml to read and render) swf2 is Sub swf(which will load (or called) inside swf1 in run time) . When try to...

String concatenation is extremly slow when input is large

Things like the code below is super slow: var str:String = "" for (var i:Number = 0 ; i<1000000000000000000 ; ++i) { str += "someLongLongLongLongLongLongLongLongLongString"; } There is StringBuilder in Java but seems there is no equivalent for AS. So, how do you guys handle large strings concatenation? Update: Thanks for every...

Comparing sentences (strings) in AS3

Hello, I'm building a short quiz where the user needs to input the meaning of an acronym. This means I need to compare a long string (usually a sentence) typed in by the user with an acronym. I have a feeling I'm not doing it right. For my testing I'm copy-pasting the correct answer to make sure the spelling is correct however I keep get...

Get Fscommand in Flex3

Hi, I have one swf file in that i used fscommand to get final output when submit button clicked in that swf , i am loading that swf in SWFloader in flex3 .i need to get fscommand value as Alert, how to get that value first and display as alert. Thanks in advance ...

Exporting FLA to FLV

Can I export the contents of FLA to FLV using Flash CS 3? I have a project where the client wants a generic media container so they can possibly load user supplied content. The content could be slideshows, or video etc. A possible solution is to restrict the media to only FLV. So that I don't have to deal with the situation where a swf...

How do I compare two instances of a class.

Let's say I have created a class named Store. This class has several elements such as Name, PhoneNumber, Owner. I've created 2 instances of this class and want to know which values are different. So lets say that Store1 and Store2 are instances of this class. Store1.Name = "John's Corner"; Store1.PhoneNumber = 111222333; Store1.Owner ...

SQL Date and Flash Date problem

I am using the local database feature in AIR 1.5. I have a table which is created by: "CREATE TABLE IF NOT EXISTS employees (timeAdded Date, name STRING)" Now lets say that I want every employee added between date1:Date and date2:Date, I would do that by using: "SELECT * FROM employees WHERE " + date1 + "<timeAdded AND timeAdded<" + ...

AS3 - Abstract Classes

How can I make an abstract class in AS3 nicely? I've tried this: public class AnAbstractClass { public function toBeImplemented():void { throw new NotImplementedError(); // I've created this error } } public class AnConcreteClass extends AnAbstractClass { override public function toBeImplemented():void { ...

Microphone detection Actionscript 3

Hi guys, I'm having a few problems detecting whether a microphone is detected or not. I'm running the function Microphone.getMicrophone() and that should return null if there is no microphone attached, or if the user has clicked Deny on the security panel, right? The problem I'm facing is, on some computers where there is no microphone ...

How to get dimensions of only DisplayObjectContainer's *visible* contents?

A DisplayObjectContainer's dimensions change based on its contents. That can be a LOT of contents, many of them with visible = false or masked, thus making them hidden. Is there a way to get only the visible contents of a DisplayObjectContainer similar to a TextField has the textHeight property, which gives you the exact dimension of wh...

Error When Using TextLayout With FlashDevelop

hi! when i using textLyout library Asset in flash develop i not LEND this error : my all code : `package { import flash.display.Sprite; import flash.display.StageAlign; import flash.display.StageScaleMode; import flashx.textLayout.container.DisplayObjectContainerController; import flashx.textLayout....

Flash AS3: Tween MC to MC on Frame to Frame

I am trying to build a four frame animation in Flash CS3. The background images (each being set to MovieClips) change on each frame, and I want to put a fade out/in transition on each of the MC's. I can't seem to get this working properly though. Here is the code I have: if (currentFrame == 1) { var alphaTweenOut1:Tween = new Tween ...

What would cause Flash (AS3) to substitute in &amp; for & in GET query params?

I've spent a day on this so far and just can't figure it out. The problem is that Flash is apparently substituting &amp; for & in my GET query params. So for example, I'm sending into a URLLoader a URLRequest with a url similar to this: http://foo.blah.com/app/index.php?abc=def&amp;ghi=jkl&amp;mno=pqr I verified this by looking at th...

How to detect if the delete key was pressed in Actionscript 3?

How do I determine if the delete key was pressed using actionscript? addEventListener(KeyboardEvent.KEY_UP, onKeyUp); ... function onKeyUp(event:KeyboardEvent):void { trace(event.keyCode); } The above code yields no value when delete, backspace, enter, and other command keys are pressed. However, arrow keys do yield values. ...

Trace what runs the function

private function dataLevel():void { //Level 2 a1=new Array(b1,b2); a2=new Array(b3,b4); //Level 1 allA=new Array(a1,a2); //trace if the following level exist //if the following level exist, create the Branch if (allA is Array==true) { createBranch(this); if (allA[0] is Array==true) { createBranch(allA[0])...

Setting textAlign to centered on a textArea, trailing spaces aren't used to determine centering

Maybe I'm doing something wrong but I have a textarea where I've specified textAlign = center and if I type in text with several trailing spaces, it doesn't count the spaces towards centering the text. If I add another character to the text (after all the spaces) it then all of a sudden centers the line, is this a bug, can anybody think...

Debuging a CRASHING flash application

Hi, What is the best way to debug a CRASHING flash app ? (no exception, my application just crash) I am actualy facing a big problem: my app (full-flash website) was working fine with the flashplayer 9 but crash with the flashplayer 10... Here is the BAD method who crash my app with FP10. After removing the call to this method everythi...

Help with Flex application design

Hello everybody! First of all, I am sorry that this is not a 'question that can be answered' like it is written in 'How to ask' section, but I think that stackoverflow is the place where I will get the best 'answers' so please help me with this one; I have in mind to make some Flex application which will be used as some kind of (powe...

Flash AS3 : how to stop data loading before completion ?

Hi, I'm developing a system which use resources(image/sound) from server. on user action, I download specific resources and use them. now, before all those resources downloading completes, If user perform another action, I want to discontinue/cancel downloading current ones. Is this possible? I tried with Loader.stop() method but it ...

Encode selected fields of 3 checkboxes into one string

Hi all, I have 3 checkboxes where the user can select whatever he wants. I would like to store his selection in the database into one field. I was thinking of encoding it into a String: 0: nothing selected 100: first selected 101: first & third selected etc. I think that's a nice way. However, how do I extract the...