Jump to content
Search Community

Blitmask trouble

ekessler test
Moderator Tag

Recommended Posts

I am having trouble with using a blitmask. It is most probably newbee mistakes.

Here is my code:

 

 


var myBlitMask:BlitMask = new BlitMask(help_mc, 0, 0, stage.width, stage.height,false);

help_btn1.addEventListener(MouseEvent.CLICK, helpMove_fn1); 
function helpMove_fn1(event:MouseEvent):void {
hideHelpClose_btn ();
TweenMax.to(help_mc,1.5,{x:helpMove * 0, ease:Expo.easeOut, onStart:myBlitMask.enableBitmapMode, onUpdate:myBlitMask.update});
}

 

help_mc is 10,240 wide.

 

I get the following error:

 

ArgumentError: Error #2015: Invalid BitmapData.

at flash.display::BitmapData/ctor()

at flash.display::BitmapData()

at com.greensock::BlitMask()

at dikdukgamewithtextfile_fla::MainTimeline/onload()

at flash.events::EventDispatcher/dispatchEventFunction()

at flash.events::EventDispatcher/dispatchEvent()

at flash.net::URLLoader/onComplete()

 

What am I doing wrong?

Thanks as always.

Link to comment
Share on other sites

My first guess would be that help_mc is too large. Flash has limitations on how much BitmapData can be stored.

 

Try the same code but make help_mc 1000px wide. If it works you you know the code is good.

 

Let us know what happens.

Link to comment
Share on other sites

Yep, it sounds like you hit the memory limit in Flash - this is unrelated to BlitMask. You can replicate the problem by creating a loop that instantiates multiple large BitmapData objects and Flash will burp eventually throwing that cryptic error. I'm not aware of any workarounds besides using smaller assets that don't require so much memory.

Link to comment
Share on other sites

this isn't true... as I am using blitmask with a 25,000 pixel wide movie clip. I have seen this error when I use stage.width and stage.height in the parameters.

 

Try changing your width and height in your parameters to actual numeric values. i.e. 1024, 768

 

also .. add the smoothing parameter ,true or ,false

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...