actionscript-3

Running a SWF from file:/// without having the user change their Flash Player security settings...

I have a Flex app that does a a fair amount of network traffic, it uses ExternalInterface to make some javascript calls (for SCORM), it loads XML files, images, video, audio and it has a series of modules that it could be loading at some point... So the problem is - we now have a requirement where the user needs to run this content loca...

How to obtain the sign of a Number in ActionScript 3.0?

I have a variable of type Number, and i like to obtain the sign (if is '-' i like to have -1 and if '+' i like to have 1). So, i made this: var sign = Math.abs(n) / n; But, there is any other way? Better than this? ...

Best Flash Audio/Video + Interactivity server?

I'm looking for suggestions on Flash realtime servers. Currently, we use a combination of Moock's Unity and Red5, but there are a couple problems. First, we are moving to AS3, and Unity only supports AS2. Secondly, Red5 is pretty flaky for us, we'd prefer something more stable. We can't use the official Flash Media Server, it's a bit out...

Does anyone know of a php framework that would handle progressive enhancement for Flash/Flex content?

Ok, I'm using the term "Progressive Enhancement" kind of loosely here but basically I have a Flash-based website that supports deep linking and loads content dynamically - what I'd like to do is provide alternate content (text) for those either not having Flash and for search engine bots. So, for a user with flash they would navigate to:...

How do you make Flash not render an object on the Stage?

This discussion started over here but I thought it would be nice to have a definitive answer... So let's say you have MovieClip on the Stage (or a UIComponent for the Flex audience) - what do you have to do to not make it so that the user can't see the object but also so that the AVM2 doesn't even factor it in when rendering the stage f...

Flash in a browser to full screen

How can i make my flash applications in a browser in full screen mode? I know that the stage can be put in that mode, but when i run the application in any browser this doesn't work. So, this can be done, but how? ...

ActionScript 3.0 using closures for event handlers

I tried doing this: root.addEventListener("click", function () { navigateToURL(ClickURLRequest,"_self"); }); And it does add the event listener. I like using closures because they work well in this situation, however, removing the event listener requires a reference to the original function, and since I used an ano...

Detecting when a user leaves a page / browser in Flex

I have an HTML wrapper that contains a Flex application, is there an Event that I can listen on, that is triggered when a user leaves the HTML wrapper either by navigation arrows or closing the browser? Thanks. ...

Disable the error message box while loading an external movie with actionscript 3

I have a compiled swf file and a I can't edit it, but the movie is working fine (but gives an error message with a message box). I am using it from an other movie (load with as3 code). When the loader movie loads it the error message box appears. I wonder is it possible to disable the errors while loading a movie with as3. Here is the...

AS3: Is there a way to remove unknown event listeners from objects?

I want to have a reusable button which can be registered for one of many different callbacks, determined by an external source. When a new callback is set, I want to remove the old. I also want to be able to clear the callback externally at any time. public function registerButtonCallback(function:Function):void { clearButtonCallback...

Mate actionscript only version, does it exist?

Hey there, I'm looking into using Mate, but the projects I work on do not require the majority of the functionality of the Flex framework. My workmate said that he heard of an Actionscript version, but I can find no information on the main site about this, only that they have removed some dependencies on the Flex framework. Does anyone...

Determine if swf is in a "debug" player or mode

Is there a way using Flash (CS3+AS3) to determine if the published swf is running in a debug player or in Flash's debug mode? I'm aware that Flex provides the ability to setup different build targets (release/debug) and that you can use something like CONFIG::debug for #ifdef style inclusion of code at compile time. I'm imagining somet...

AIR Caching framework/library

Anyone know of a good memory/disk caching library for AIR? Extra points for being compatible with Flash CS3, and being free (as in beer). I'd like to cache results of http requests: both binary and text (xml). ...

Actionscript3 E4X XML and CSS: Do I really have to use CDATA?

When working with CSS inside of XML such as <span class="IwuvAS3"></span> when parsed in flash, if I don't use CDATA like the following: <![CDATA[<span class="IwuvAS3"></span>]]> then the parsed data drops down a line for every "<" character it sees. When parsing the data into a single-line text field, nothing was shown because it...

RFC timestamp in Flash/AS3

I'd like to know if Flash/AS3 has any nice way to convert an AS3 'Date' object to/from rfc-850 timestamp format (as used by HTTP date and last-modified). This question is very similar to this question about rfc 3339, except it's specific to AS3 and rfc-850. RFC-850 is like: Thu, 09 Oct 2008 01:09:43 GMT ...

Access HTTP response headers in for flash.net.URLLoader object?

Is there a way to access the response headers from an HTTP result when using Flash/Flex's URLLoader? Setting the request headers is possible, as is accessing the response code, but getting a hold of the actual response headers seems to be conspicuously lacking... Specifically, I would like to get a hold of the Last-Modified response he...

having trouble with insertChildBefore and insertChildAfter in AS3

i have an xml document: var xml:XML = new XML(<rootNode> <head> <meta name="template" content="Default" /> </head> <mainSection> <itemList> <item> <video src={this.videoURL} /> <img src={this.src}></img> </item> </itemList> </mainSection> ...

Multiple viewports of the same DisplayObject

Is it possible to have multiple view of the same display object? (e.g. same-computer multi-player game using split screen) The sample code that failed to work follows: var content: Sprite = new Sprite(); var v1: Sprite = new Sprite(); var v2: Sprite = new Sprite(); with(content.graphics) { lineStyle(2, 0xff0000...

Force Garbage Collection in AS3?

Is it possible to programmatically force a full garbage collection run in ActionScript 3.0? Let's say I've created a bunch of Display objects with eventListeners and some of the DO's have been removed, some of the eventListeners have been triggered and removed etc... Is there a way to force garbage collection to run and collect everythi...

Good examples or documentation of XIFF implementation?

XIFF is an implemenation of the XMPP protocol in actionscript. So far, all the examples and documentation I have seen are sparse. Does anyone know a good explanation of the most recent version of XIFF and/or good examples of working Flex/AIR applications? ...