Flash As3 Loader Problem - actionscript-3

Hi iam trying to load a few external jpegs in As3.
It works fine locally in Flash, but it dosen't work at all ion my server.
My app also loads a youtube video simultaneously.
function drawResult(index,videoID,song_title,thumbnail:String=null)
{
var theClip:resultRowClip=new resultRowClip ();
_clip.addChild(theClip);
myArray[index] = new Array(videoID,theClip);
theClip.y=0+(43*(index-1));
theClip.rowText.text = song_title;
theClip.rowBack.visible = false;
if (thumbnail != ""){
theClip.tHolder.visible=true;
loadImage(thumbnail,index);
}
}
function loadImage(url:String,index):void
{
//this.myClip.myText.text += "load image";
// Set properties on my Loader object
var imageLoader:Loader = new Loader();
imageLoader.load(new URLRequest(url));
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, function (evt:Event){imageLoaded(evt,index)});
}
function imageLoaded(evt,id):void
{
//this.myClip.myText.text += "id : evt : " + evt.status;
// Load Image
var image:Bitmap = new Bitmap(evt.target.content.bitmapData);
myArray[id][1].tHolder.addChild(image);
myArray[id][1].tHolder.width=myArray[id][1].tHolder.width*0.35;
myArray[id][1].tHolder.height=myArray[id][1].tHolder.height*0.35;
}
Does anyone knows what the problem is ?
** I added two Evenet listeners from io Error :
imageLoader.addEventListener(IOErrorEvent.IO_ERROR,ioErrorHandler);
imageLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,ioErrorHandler);
This is the function for handling the errors :
private function ioErrorHandler(event:IOErrorEvent):void {
this.myClip.myText.text +=("ioErrorHandler: " + event);
}
anyway, I got no errors...
I also tried to move the listeners before imageLoader.load but it's still the same...no errors and no data loaded..
I change my code to patrikS suggestion :
function loadImage(url:String,index):void
{
//this.myClip.myText.text += "load image";
// Set properties on my Loader object
//if (index != 1) return;
var imageLoader:Loader = new Loader();
imageLoader.name = index.toString();
//myArray[index][1].addChild(imageLoader);
//imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, function (evt:Event){imageLoaded(evt,index)});
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,completeHandler);
imageLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,ioErrorHandler);
imageLoader.load(new URLRequest(url));
}
My current completeHandler function(tnx patrikS ) :
private function completeHandler(evt:Event):void{
//this.myClip.myText.text += "id : evt : " + evt.status;
// Load Image
trace("evt target loader name : "+ evt.target.loader.name );
evt.target.removeEventListener(Event.COMPLETE, completeHandler );
var image:Bitmap = new Bitmap(evt.target.content.bitmapData);
myArray[evt.target.loader.name][1].tHolder.addChild(image);
myArray[evt.target.loader.name][1].tHolder.width=myArray[evt.target.loader.name][1].tHolder.width*0.35;
myArray[evt.target.loader.name][1].tHolder.height=myArray[evt.target.loader.name][1].tHolder.height*0.35;
//trace (hadar.y + "Y / X" + hadar.x);
}
It still work only on flash IDE and dosent work on any browser...

try urlstream and check crossdomain.xml :)
urlstream = new URLStream();
urlstream.addEventListener(Event.COMPLETE, onLoad);
urlstream.addEventListener(IOErrorEvent.IO_ERROR, onErr);
urlstream.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onErr);
urlstream.load(req);
private function onLoad(e:Event):void {
var ba:ByteArray = new ByteArray();
urlstream.readBytes(ba, 0, urlstream.bytesAvailable);
_loader.contentLoaderInfo.addEventListener(Event.INIT, onBytesLoad);
_loader.loadBytes(ba);
}

Listeners should be added before calling the load() method.
Also there's no real advantage in using a closure for the complete event listener & think of removing the event listeners!
function loadImage(url:String, index:int):void
{
//this.myClip.myText.text += "load image";
// Set properties on my Loader object
var imageLoader:Loader = new Loader();
imageLoader.name = index.toString();
//make sure you to add your listeners here!
imageLoader.contentLoaderInfo.addEventListener(
IOErrorEvent.IO_ERROR,ioErrorHandler);
imageLoader.contentLoaderInfo.addEventListener(
Event.COMPLETE, completeHandler );
imageLoader.load(new URLRequest(url));
}
function completeHandler(event:Event ):void
{
//imageLoaded(evt,index);
trace( event.target.loader.name );
event.target.removeEventListener(Event.COMPLETE, completeHandler );
}

In debug model, you can load files from any avaliable site, but release model.
may be this help : http://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html

Related

ActionScript3 remove child error

I recently have been converting an as2 fla to as3 (new to AS3) and have the entire thing working on export, but I am getting an error when I try to remove previously loaded swf's before a new swf is loaded
ArgumentError: Error #2025: The supplied DisplayObject
must be a child of the caller.
at flash.display::DisplayObjectContainer/removeChild()
at MethodInfo-11()
I know the error relates to my removeChild code here:
`stage.addEventListener(MouseEvent.CLICK, removeSWF);
function removeSWF (e:MouseEvent):void
{
if(vBox.numChildren !=0){
// swfLoader.unloadAndStop();
vBox.removeChild(swfLoader);// empty the movieClip memory
}
}`
However, I cannot seem to find a suitable rewrite for this code that will work and not have an error. This code IS working, so I'm not sure if it would be worth my time to fix this error, or just leave it. I've already messed with it for a couple days, so at this point it's just frustrating me that I cannot fix it.
The stage mouse click listener is useful in this case because I have a back button not shown in this code that clears the loaded swf's before moving to another scene.
Does anyone see a simple solution for this, or do you think it is unnecessary to pursue since the code does what I require?
ENTIRE CODE:
function launchSWF(vBox, vFile):void {
var swfLoader:Loader = new Loader();
var swfURL:URLRequest = new URLRequest(vFile);
swfLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadProdComplete);
swfLoader.load(swfURL);
function loadProdComplete(e:Event):void {
trace("swf file loaded");
vBox.removeChild(preLoader);
vBox.addChild(swfLoader);
currentSWF = MovieClip(swfLoader.content);
currentSWF.gotoAndPlay(1);
currentSWF.addEventListener(Event.ENTER_FRAME , checkLastFrame);
swfLoader.x = 165;
swfLoader.y = 15;
function checkLastFrame(e:Event):void {
if (currentSWF.currentFrame == currentSWF.totalFrames) {
currentSWF.stop();
// trace("DONE");
}
}
}
var preLoader:loader = new loader();
preLoader.x = 450;
preLoader.y = 280;
vBox.addChild(preLoader);
function onProgressHandler(event:ProgressEvent){
var dataAmountLoaded:Number=event.bytesLoaded/event.bytesTotal*100;
//preLoader.bar.scaleX = dataAmountLoaded/100;
preLoader.lpc.text= int(dataAmountLoaded)+"%";
//trace(preLoader.bar.scaleX );
}
//NEW ERRORS BUT WORKING
stage.addEventListener(MouseEvent.CLICK, removeSWF);
function removeSWF (e:MouseEvent):void
{
if(vBox.numChildren !=0){
// swfLoader.unloadAndStop();
vBox.removeChild(swfLoader);// empty the movieClip memory
}
}
}
var container:MovieClip = new MovieClip();
var currentSWF:MovieClip = new MovieClip();
fall_b.addEventListener(MouseEvent.CLICK, fall_bClick);
function fall_bClick(e:MouseEvent):void {
var swfFile:String = 'load/fall.swf';
launchSWF(container, swfFile);
addChild(container);
}
face_b.addEventListener(MouseEvent.CLICK, face_bClick);
function face_bClick(e:MouseEvent):void {
var swfFile:String = 'load/face.swf';
launchSWF(container, swfFile);
addChild(container);
}
rott_b.addEventListener(MouseEvent.CLICK, rott_bClick);
function rott_bClick(e:MouseEvent):void {
var swfFile:String = 'load/rottgut.swf';
launchSWF(container, swfFile);
addChild(container);
}
//MORE SWFS...
Any advice anyone has is appreciated
First of all function launchSWF(vBox, vFile):void { isn't closed. You've also got function inside functions which is easy enough for you to solve if you click the lines the curly brackets start and end on to track them.
I can't see anything wrong with the code you said has an error but I'm guessing this isn't all the code. If you using Flash Professisonal you can use permit debugging to show the line the error is on.
EDIT: Please note this hasn't been tested as I'm on my mobile writing out code. That being said this should now work:
var container:MovieClip;
var currentSWF:MovieClip;
var swfFile:String;
var swfLoader:Loader;
var preLoader:Loader;
var swfURL:URLRequest;
init();
function init():void {
preLoader = new Loader();
preLoader.x = 450;
preLoader.y = 280;
vBox.addChild(preLoader);
container = new MovieClip();
currentSWF = new MovieClip();
fall_b.addEventListener(MouseEvent.CLICK, fall_bClick);
face_b.addEventListener(MouseEvent.CLICK, face_bClick);
rott_b.addEventListener(MouseEvent.CLICK, rott_bClick);
stage.addEventListener(MouseEvent.CLICK, removeSWF);
}
function launchSWF(vBox, vFile):void {
swfLoader = new Loader();
swfURL = new URLRequest(vFile);
swfLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadProdComplete);
swfLoader.load(swfURL);
}
function loadProdComplete(e:Event):void {
trace("swf file loaded");
vBox.removeChild(preLoader);
vBox.addChild(swfLoader);
currentSWF = MovieClip(swfLoader.content);
currentSWF.gotoAndPlay(1);
currentSWF.addEventListener(Event.ENTER_FRAME , checkLastFrame);
swfLoader.x = 165;
swfLoader.y = 15;
}
function checkLastFrame(e:Event):void {
if (currentSWF.currentFrame == currentSWF.totalFrames) {
currentSWF.stop();
// trace("DONE");
}
}
function onProgressHandler(event:ProgressEvent) {
var dataAmountLoaded:Number = (event.bytesLoaded / event.bytesTotal * 100);
//preLoader.bar.scaleX = dataAmountLoaded/100;
preLoader.lpc.text = int(dataAmountLoaded)+"%";
//trace(preLoader.bar.scaleX );
}
function removeSWF (e:MouseEvent):void {
if(vBox.numChildren !=0){
//swfLoader.unloadAndStop();
vBox.removeChild(swfLoader);// empty the movieClip memory
}
}
function fall_bClick(e:MouseEvent):void {
swfFile = 'load/fall.swf';
launchSWF(container, swfFile);
addChild(container);
}
function face_bClick(e:MouseEvent):void {
swfFile = 'load/face.swf';
launchSWF(container, swfFile);
addChild(container);
}
function rott_bClick(e:MouseEvent):void {
swfFile = 'load/rottgut.swf';
launchSWF(container, swfFile);
addChild(container);
}
I have this rewritten. I could not get the vBox errors cleared in the original code, and I was getting many other errors with what was posted. The vBox code was seen on a tutorial. I think it was supposed to reference the loader for the preloader and the swf, and vFile was for the actual .swf. The following code preloads multiple swfs and clears them with no errors. I appreciate your help AntBirch. I'm beginning to understand loaders in as3 a little more now.
//LOAD FIRST PIECE ON OPEN (required to removeChild later)
var swfLoader:Loader = new Loader();
var defaultSWF:URLRequest = new URLRequest("load/fall.swf");
swfLoader.load(defaultSWF);
swfLoader.x = 165;
swfLoader.y = 15;
addChild(swfLoader);
//PRELOADER
var preLoader:loader = new loader();
preLoader.x = 450;
preLoader.y = 280;
function loadProdComplete(e:Event):void {
trace("swf file loaded");
removeChild(preLoader);
addChild(swfLoader);
}
function onProgressHandler(event:ProgressEvent){
var dataAmountLoaded:Number=event.bytesLoaded/event.bytesTotal*100;
preLoader.lpc.text= int(dataAmountLoaded)+"%";
}
//BUTTONS
function btnClick(event:MouseEvent):void {
swfLoader.unloadAndStop();
removeChild(swfLoader);
swfLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadProdComplete);
addChild(preLoader);
var newSWFRequest:URLRequest = new URLRequest("load/" + event.target.name + ".swf");
swfLoader.load(newSWFRequest);
swfLoader.x = 165;
swfLoader.y = 15;;
addChild(swfLoader);
}
// BUTTON LISTENERS
fall.addEventListener(MouseEvent.CLICK, btnClick);
face.addEventListener(MouseEvent.CLICK, btnClick);
rott.addEventListener(MouseEvent.CLICK, btnClick);
angel.addEventListener(MouseEvent.CLICK, btnClick);
ratts.addEventListener(MouseEvent.CLICK, btnClick);
metal.addEventListener(MouseEvent.CLICK, btnClick);
//etc...
//BACK BUTTON
BB3.addEventListener(MouseEvent.CLICK, BB3Click);
function BB3Click(e:MouseEvent):void {
swfLoader.unloadAndStop();
removeChild(swfLoader);
this.gotoAndPlay(1 ,"Scene 2")
}

close / unload UiLoader as3

I'm using a Loader to display a SWF. I have a button to load the SWF and I want that same button to close or hide or unload the SWF.
Here's part of my code:
var so:Boolean = false ;
glossary.addEventListener(MouseEvent.CLICK, glossaire)
function glossaire (e:MouseEvent) {
var myLoader:Loader = new Loader();
var url:URLRequest = new URLRequest("glossary.swf");
if (so == false )
{
so = true ;
myLoader1.load(url);
addChild(myLoader);
}
else{
so = false ;
//i tried
myUILoader.unload();
removeChild(myUILoader);
// but my loader still appear in the stage how can remove or hide it
}
}
Your issue is that your loader is scoped to the click function, and that you are creating a new Loader every click (when really you only want to create a new loader on the first click). Also, you seem to be confused on what your loader is called as you have references to myLoader, myLoader1 and myUILoader.
//put the loader var out of the function scope here (so it persists after the function finishes).
var myLoader:Loader;
glossary.addEventListener(MouseEvent.CLICK, glossaire);
function glossaire (e:MouseEvent){
//instead of using the so boolean, just check if loader is null
if (myLoader == null){
myLoader = new Loader();
myLoader.load(new URLRequest("glossary.swf"));
addChild(myLoader);
}else{
myLoader.unloadAndStop();
removeChild(myLoader);
myLoader = null; //set it to null now that it's been removed, so the next time this click function runs, a new loader will be made
}
}
If you just wanted to hide the loaded swf (instead of completely unloading it), you could do this:
function glossaire (e:MouseEvent){
//create the loader and load if it hasn't been done yet
if (myLoader == null){
myLoader = new Loader();
myLoader.load(new URLRequest("glossary.swf"));
}
//the parent property of the loader will be null if it hasn't been added (or has been removed) via addChild/removeChild
if(myLoader.parent != null){
removeChild(myLoader);
}else{
addChild(myLoader);
}
}
Ok , let me tell you an easy way to solve this issue,
Create a load complete event Event.Complete and listen it to a function , set a boolean from there , in your case var so:Boolean and use the same functionality,
var so:Boolean = false ;
glossary.addEventListener(MouseEvent.CLICK, glossaire)
function glossaire (e:MouseEvent) {
var myLoader:Loader = new Loader();
var url:URLRequest = new URLRequest("glossary.swf");
myLoader.contentLoaderInfo.addEventListener( Event.COMPLETE, swfload);
if (so == false )
{
so = true ;
myLoader.load(url);
addChild(myLoader);
}
else{
so = false ;
//i tried
myUILoader.unload();
removeChild(myUILoader);
// but my loader still appear in the stage how can remove or hide it
}
}
function swfload(e:Event):void
{
if(e.type == Complete)
so = false;
}

action script 3.0 .I had tried a program that should move the dragger as well as the content movieclip,

In this code i need a progressbar to progress through while the imported .swf file is playing, meanwhile i should able to drag the dragger in the progress bar (i.e the rate of movement of dragger should sync with rate of .swf file playing). I got Argument error: #2109 Frame label 459.99 not found in scene1.
var loader:Loader = new Loader();
playBtn.visible = true;
pauseBtn.visible = false;
btn_00.addEventListener(MouseEvent.CLICK, fileLoaded);
btn_01.addEventListener(MouseEvent.CLICK, fileLoaded);
btn_02.addEventListener(MouseEvent.CLICK, fileLoaded);
function fileLoaded(evt:MouseEvent):void
{
var fileName:String = evt.currentTarget.name;
var fileNumber:String = fileName.split("_")[1];
var urlPath:String = "assets/file_" + fileNumber + ".swf";
loader.load(new URLRequest(urlPath));
addChild(loader);
}
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, swfLoaded);
function swfLoaded(event:Event):void
{
addEventListener(Event.ENTER_FRAME, trackPlayback);
}
function trackPlayback(event:Event):void
{
var perPlayed:Number = MovieClip(loader.content).currentFrame / MovieClip(loader.content).totalFrames;
progressbar.drag.x = (progressbar.bar.width - progressbar.drag.width) * perPlayed;
}
progressbar.drag.buttonMode = true;
var dragClicked:Boolean = false;
var xpos:Number = progressbar.bar.x * progressbar.drag.width;
progressbar.drag.addEventListener(MouseEvent.MOUSE_DOWN,dragMouseDown);
function dragMouseDown(evt:MouseEvent):void
{
trace(" inside mouse down ");
dragClicked = true;
progressbar.drag.startDrag(false,new Rectangle(xpos,0,progressbar.width-progressbar.drag.width,0));
}
progressbar.drag.addEventListener(MouseEvent.MOUSE_UP,dragMouseUp);
function dragMouseUp(evt:MouseEvent):void
{
dragClicked = false;
progressbar.drag.stopDrag();
var cnt:Number = (progressbar.drag.x/(progressbar.width-progressbar.drag.width))*MovieClip(loader.content).totalFrames;
MovieClip(loader.content).gotoAndPlay(cnt);
}
Pls solve my issue.
Thanks in advance.
To access a specific frame, you need to provide an integer value where at the moment you are using a floating-point value.
A simple fix would be to cast the Number to an int:
MovieClip(loader.content).gotoAndPlay(int(cnt));

Infinite file size loading as3

I'm trying to load a big xml feed within ActionScript3. The problem is that the progress event indicate that the bytesTotal is zero and this result in a infinite loading sequence. The complete handler is never triggered.
This is what is do.
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadDone);
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, dataAnalyzeProgress)
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, io_error);
var urlRequest:URLRequest = new URLRequest(url);
loader.load(urlRequest);
protected function io_error(event:IOErrorEvent):void
{
trace("IO ERROR")
trace(event.text)
}
protected function loadDone(event:Event):void
{
trace('DATA COMPLETE')
trace(event.target.content)
}
protected function dataAnalyzeProgress(e:ProgressEvent):void
{
trace((e.bytesLoaded / e.bytesTotal) *100+"%");
trace("Downloaded " + e.bytesLoaded + " out of " + e.bytesTotal + " bytes");
if(e.bytesTotal == 0)
{
loader.close();
}
}
Does somebody have a solution for this problem. I tried load it through curl i first, but still the same problem...
You need to use URLLoader class for loading xml data, not Loader. Loader class is for loading SWF and pictures (JPG, PNG, GIF). Try these lines:
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, loadDone);
loader.addEventListener(ProgressEvent.PROGRESS, dataAnalyzeProgress)
loader.addEventListener(IOErrorEvent.IO_ERROR, io_error);
var urlRequest:URLRequest = new URLRequest(url);
loader.load(urlRequest);

ActionScript 3: LoaderInfo COMPLETE event doesn't fire after load() and loadBytes()

I'm trying to load PNG images with ActionScript with a Loader object. This works fine for some of the images (the INIT and COMPLETE events are fired as expected), for some other it doesn't. I've read in this thread that a URLLoader might help, so I tried that, using the loadBytes() function afterwards. Still doesn't work: the URLLoader fires the COMPLETE event, but the LoaderInfo object does not.
I've written a sample class that demonstrates the problem with two files (one working, the other one not).
public class LoaderTest extends MovieClip {
var output:TextField;
var loader:Loader;
var urlLoader:URLLoader;
function LoaderTest() {
output = new TextField();
output.width = 1000;
output.height = 1000;
output.multiline = true;
addChild(output);
var t1:Timer = new Timer(0, 0);
t1.addEventListener(TimerEvent.TIMER, function() {
t1.stop(); loadMapDirect("map_in_big.png");
});
var t2:Timer = new Timer(1000, 0);
t2.addEventListener(TimerEvent.TIMER, function() {
t2.stop(); loadMapDirect("map_us_big.png");
});
var t3:Timer = new Timer(2000, 0);
t3.addEventListener(TimerEvent.TIMER, function() {
t3.stop(); loadMapBytes("map_in_big.png");
});
var t4:Timer = new Timer(3000, 0);
t4.addEventListener(TimerEvent.TIMER, function() {
t4.stop(); loadMapBytes("map_us_big.png");
});
t1.start();
t2.start();
t3.start();
t4.start();
}
function loadMapBytes(url:String):void {
try {
urlLoader = new URLLoader();
urlLoader.dataFormat = URLLoaderDataFormat.BINARY;
urlLoader.addEventListener(ProgressEvent.PROGRESS, progressListener);
urlLoader.addEventListener(Event.COMPLETE, completeListenerBytes);
output.appendText("\nLoading '"+url+"' with URLLoader ");
urlLoader.load(new URLRequest(url));
} catch (error:Error) {
output.appendText("Err: " + error.message + "\n");
}
}
function completeListenerBytes(e:Event):void {
output.appendText("COMPLETE Event fired for URLLoader!\n");
try {
loader = new Loader();
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressListener);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeListenerDirect);
output.appendText("Loading bytes with Loader ");
loader.loadBytes(e.target.data as ByteArray);
} catch (error:Error) {
output.appendText("Err: " + error.message + "\n");
}
}
function loadMapDirect(url:String):void {
try {
loader = new Loader();
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressListener);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeListenerDirect);
output.appendText("\nLoading '"+url+"' with Loader ");
loader.load(new URLRequest(url));
} catch (error:Error) {
output.appendText("Err: " + error.message + "\n");
}
}
function completeListenerDirect(e:Event):void {
var bmd:BitmapData = Bitmap(e.target.loader.content).bitmapData;
output.appendText("COMPLETE Event fired for Loader! => h: " + bmd.height + ", w: " + bmd.width + "\n");
}
function progressListener (e:ProgressEvent):void{
output.appendText(".");
if (e.bytesLoaded == e.bytesTotal) {
output.appendText(" progress complete, " + e.bytesTotal + " bytes loaded!\n");
}
}
}
All images were generated with the PHP GD library and I'm compiling with SWFTools's as3compile.
You can see the script it in action on http://www.wichte-sind-wichtig.de/as3loader/loaderTest.swf
The two images map_in_big.png and map_us_big.png are in the same folder (not allowed to post more hyperlinks).
Any ideas?
The problem is that your application is probably compiled for Flash Player 9. In version 9 the maximum allowed image dimensions are 2880 x 2800 and map_us_big.png is 3150 x 1570. I ran the application successfully when I compiled it for Flash Player 10.
Here's a reference http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/BitmapData.html#BitmapData%28%29
In AIR 1.5 and Flash Player 10, the maximum size for a BitmapData
object is 8,191 pixels in width or height, and the total number of
pixels cannot exceed 16,777,215 pixels. (So, if a BitmapData object is
8,191 pixels wide, it can only be 2,048 pixels high.) In Flash Player
9 and earlier and AIR 1.1 and earlier, the limitation is 2,880 pixels
in height and 2,880 pixels in width. If you specify a width or height
value that is greater than 2880, a new instance is not created.