Jump to content
Search Community

animation on bitmap

DCstyle test
Moderator Tag

Recommended Posts

so i have a sprite Container with within that a bitmap from bitmapdata. now i tryed all kinds of things but i cant seem to find out how to apply tweens directly on that bitmap object instead of the sprite.

 

Now if i do use the sprite for animation it starts fine but as soon i replace images or start working with alpha old objects that get overcollered by fillRect function return visible.

 

any help would be welcome.

Link to comment
Share on other sites

I don't quite understand the question. Perhaps a super-simple reduced test case would help. Can you post a demo FLA? (please zip it first, and click the "more reply options" below to get to a screen where you can attach files). 

 

This doesn't sound like a GSAP question, though - it sounds like a more general Flash issue. 

  • Like 1
Link to comment
Share on other sites

well i guess it could be a problem without using greensock too, but i thought cause im using greensock for my tweens you guys might be able to help me out better.

 

i cant make a sample fla that fast but instead i post some code heres what i mean:

public function blit(o)
{
objectHolder=o;

var imgSheet:BitmapData=new sponsorsSheet;
var imgHolder=new BitmapData(400,400,true);
objectHolder.addChild(new Bitmap(imgHolder)); // the objectHolder is the sprite im animating.

//first timelinetween i add this image:

IMG = new blitSprite(imgSheet, R.img1, imgHolder);

//when its rendered by copypixel method i start a timelinetween that runs from alpha 0 to 1 and from //1 back to 0 to make a fade in / fade out animation.
//than onComplete i want my second image to fade in / out so i first clear the Rectangle:

imgHolder.fillRect(R.img1, 0x00FF00); // turns it green for testing purpose than when i add img 2:

IMG = new bitSprite(imgSheet, R.img2, imgHolder);

it all seems to work but when i start the fade tween the img1 apears in the alpha cause simply filing the rectangle doesnt seem to extualy clear the older image but just putting anotyer layer of paint over it. so instead of using the. Fade animation on a sprite is there any way i could apply it to the bitmap (img1, img2) itself?

Link to comment
Share on other sites

ok so i found the problem myself.

i was refering the same sprite in both animations. and than i started a tween to increase alpha while at the end of the first transition the alpha was already at zero. 

so i went from zero to zero. anyway its working now support is no longer needed .

 

Tnx

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...