Jump to content
GreenSock

undefinedman

Problem with Mouse Over and fade in a few objects

Recommended Posts

Hello,

 

i got the problem.. I am alredy building the website, where I need to change the colors of the landscapes when I MOUSE_OVER on activators, but the problem is when I MOUSE_OVER the script stops for half second and then it works ok, but always the first time is not correct..

 

 

there is demo online:

 

www.grzegorztomasiak.pl/www/demo

 

 

when you go to blue activator you can see how problem looks..

 

code:

	private function spookyHouse_MOUSE_OVER(e:MouseEvent=null):void {
		arrayInit(new Array(
			layer_1_spookyHolder,
			layer_2_spookyHolder,								
			layer_3_spookyHolder,
			layer_4_spookyHolder
		));
		function arrayInit(_Array:Array=null):void {
			for(var a:String in _Array) {
				TweenNano.to(_Array[a], 1, {alpha:1});
			}
		}			

		//disableDefaultLandscape();			
	}

 

I tried TweenNano, Lite, Max, and still the same problem.

Link to comment
Share on other sites

Czesc undefinedman,

The demo, would not load for me, however, have you tried using ROLL_OVER/OUT instead of MOUSE_OVER/OUT, not sure this will fix your problem looking at your code snippet, but worth a try.

X10

Link to comment
Share on other sites

i don't know if it is causing the problem, but I've read repeatedly that you should not nest functions inside each other.

 

try something like this:

 

private function spookyHouse_MOUSE_OVER(e:MouseEvent=null):void {

var clipArrayArray = new Array(

layer_1_spookyHolder,

layer_2_spookyHolder,

layer_3_spookyHolder,

layer_4_spookyHolder

);

TweenMax.allTo(clipArray, 1, {alpha:1});

 

//disableDefaultLandscape();

}

 

I also noticed that all your motion code stops apruptly the first time you rollover the activator which means something very strange is happening. without seeing more of how the file is built and other code, there isn't much more to say. your code really should work and so should mine.

Link to comment
Share on other sites

Hello again,

 

really thank you guys for the answers, but unfortunately did not help to me..

 

I think the problem is caused by very larg files.. I have 5 png files converted to MovieClips.. If I tween one image or two images it's OK, but when I tween five of them - now it's a problem..

 

Any advices?

Link to comment
Share on other sites

I forgot to tell you that I am using LoaderMax to load the Images;

 

var layer_1:ImageLoader = new (_XML.LANDSCAPE.SPOOKY.Layer_1, {});

etc...

 

and then I'm adding these loaders to MovieClips.

 

layer_1_spookyHolder.addChild(layer_1.content);

etc...

Link to comment
Share on other sites

doing alpha fades on very large bitmaps is one of the most processor intensive tasks you can ask of the Flash Player.

 

there is nothing that GreenSock can do to overcome the limitations of the player.

 

perhaps you can build a similar effect using colorTransform plugin or blend modes.

Link to comment
Share on other sites

So what you suggest, what should I do? How can I tween fade in without the alpha property?

 

In flash player - directly in flash cs5 whole swf works perfect, without any problems, I tried i guess everything....

Link to comment
Share on other sites

I don't know it is a good way but I did something like that:

 

				 TweenMax.to(sunrise_spooky.content, 1, {autoAlpha:1});
				 TweenMax.to(layer_1_spooky.content, 1, {autoAlpha:1, delay:.1});
				 TweenMax.to(layer_2_spooky.content, 1, {autoAlpha:1, delay:.2});
				 TweenMax.to(layer_3_spooky.content, 1, {autoAlpha:1, delay:.3});
				 TweenMax.to(layer_4_spooky.content, 1, {autoAlpha:1, delay:.4});

 

and it works, better than last time..

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