actionscript-3

Playing one sound at a time in AS3, called from javascript

I'm working on a site, for kids, which has a small avatar in the corner that talks. The avatar is a flash file and the plan is to determine what it says through a mix of javascript and ajax. Unfortunately when I make the flash file play an Mp3 file through JavaScript, I can't seem to stop the sound.. so when I keep clicking on a link wh...

problem with textField.htmlText and apostrophe (')

Apostrophe is shown in textField.htmlText as &apos (which is not a valid html encoding of apostrophe), intead of &#39. How can i change it? ...

Resize Image with Scroller causing 1502 exception

Description: I'm loading an image inside of a border container and when i zoom out, the scroll bars disappear as expected. Now when I resize the image to exceed the boundaries of the boarder container I receive the exception below. I believe the exception is thrown when the scroll bars are reactivating but i could be wrong. Has anyone se...

Best(simplest) method or framework to track user's history in Flash

I've used SWFAddress, but it seems full of quirks, and not fully implemented in all browsers. I don't necessarilly need deep linking, rather I simply need to track a users history as he she travels thru a flash application (user stays in application). Any suggestions, desgin pattern recommendations, code examples? ...

left-justify textfield without resizing

I would like to set a fixed width for an input textfield with an embedded font. I would like to have the option to left-, right-, or center-justify the text. This is proving difficult. If I set myTextField.autoSize = TextFieldAutoSize.LEFT;, I get left-justified text, but the textfield width changes with each keystroke. Same trade-of...

Casting a retrieved Mediator with PureMVC as its proper class returns null

I have a mediator that I've registered for a navigation page: facade.registerMediator(new NavPageMediator(viewComponent)); I'm trying to retrieve that mediator on another page like so: var navPageMediator:NavPageMediator = facade.retrieveMediator(NavPageMediator.NAME) as NavPageMediator; However, that statement returns null. If...

AS3 Array question

var firstarray:Array = new Array(); function traceArray(arr:Array){ for(var i:int = 0; i < arr.length; ++i) { trace(firstarray[i].matrix); } } for (var i:int = 0; i < 10; ++i) { firstarray.push({ matrix:[1,0,0,1], prod:i}); } var secondarray:Array = new Array(); secondarray = firstarray; secondarra...

Displaying caught errors outside of IDE - overkill/critique?

I have devised the following method for catching errors throughout my AS3 applications: In the Document class, define the following methods: //This is the handler for listening for errors protected function catchError(event:ErrorEvent):void { displayError('Error caught: ' + event.text); } //Creates a MovieClip with a TextField as ...

Can't connect to Twitter API in AS3

I'm trying to connect to the Twitter API via an AS3 app, but I keep getting Error #2032: Stream Error. URL: https://api.twitter.com/oauth/request_token When I try URLRequest("https://api.twitter.com/oauth") it at least loads something and calls my Event.COMPLETE listener. Can Flash just not connect to the Twitter API without a third-pa...

flash Actionscript 3 and php image upload

hi friends, recently i am going through a project of badge-builder with action-script and flash.now i need some help for image uploading from the flash interface to the server and showing it back in the flash interface, the back-end programing language is php and i am using action-scrip 3 and flash cs5 can anyone please give me a righ...

AS3 Embedded font in linked SWC/source blanks out when setting dynamic text field

Okay, that's a fairly complicated title up there, so I'll explain the setup that's causing this error first. I've got a number of related projects set up in Flash Builder. Each project gets its graphical assets from an exported SWC file (or multiple SWC files.) This works fine, but I wanted to create a shared project that contains stuff...

RegEx get all characters before

I have this regular expression to get urls: (((ht|f)tp(s?))\://)?(www.|[a-zA-Z].)[a-zA-Z0-9-.]+.(com|edu|gov|mil|net|org|biz|info|name|museum|us|ca|uk)(\:[0-9]+)*(/($|[a-zA-Z0-9.\,\;\?\'\+&%\$#\=~_-]+))* And I want to modify it so that when I call to make an array of the matched strings it will get everything before it as well. How ...

Set Selection in AS3

How do I get Set Selection to work in a text field. I have a text field inside a movieclip and a button with a click listener on it. When it clicks I want it to select all the text inside. This is what I have so far, I hope you can help. send.addEventListener(MouseEvent.CLICK, function() { panel.tweet.selectable = true; stage.f...

Actionscript collisions: solving exceptions and strange cases

I have created a collision class to detect collisions using pixels. In my class I've also developed some functions for determining the collsion angle. Based on this I created some examples: http://megaswf.com/serve/25437/ http://megaswf.com/serve/25436/ (Space to change gravity, right/left to give some speed to the ball.) As you will...

AS3 code stops compiling when I make a string

One of you AS3 wizards must know this one, if I include this line. var a:String = ""; My code stops executing. Commented out, it works fine. ...

Why would an SWF load in the Flash CS3 IDE but not the browser?

I have five SWF files that are loaded into a main SWF. All five load when testing in the Flash CS3 IDE. When testing in the browser, only three of the five SWF files load. Loading just haults after the first three. No IOErrorEvent is triggered, and I am sure that the URLs for the SWFs are correct. I have used MonsterDebugger to pinpoin...

Handle VerifyError: Error #1014 when loading swfs using AS3

We are making a system that has a main swf for the application, and loads separate tools from separate swfs -- there will be versioning issues in the future since the separate swfs are coming from a cms (especially now since we're still developing, but also in the future when other developers might create an incompatible tool). I'm tryin...

URLLoader handler in child movie not being called.

Hi I am writing a flex application that has a MainMovie that loads flex programs (ChildMovie) depending on what the user selects in the MainMovie. below is some pseudocode to help me describe my problem hopefully. class MainMovie{ private var request:URLRequest = new URLRequest(); public function callPHPfile(param:String, loader:...

Extending a class with multiple classes

I'm creating a class that extends another class. public class ASClass extends UIComponent{ } but I'm trying to make it extend multiple classes. Is this somehow possible? I read it may be possible through composition? ...

Embed many graphics using an array

In AS3 you can embed a graphic into a Class variable: [Embed(source="MenuAssets.swf", symbol="topSquare")] public var TopMenuItem:Class; I have hundreds of assets in this one website project I'm doing, so I want to embed assets into an array for quick access. Can I do something like this? Its not compiling so I'm wonderi...