Jump to content
Search Community

Double Code Definion Problem

CHA test
Moderator Tag

Recommended Posts

Hello All.,.,.,

 

i have a Menübar Flash with 13 Single mc`s (movie clips)!

For the First mc i have choise a bezier Code, it works perfecty!

 

But when i put the same Code to a second mc than comes an error:

 

1151 (Namespace Conflict)

1021 (Double Funktion Definion)

3596 (Double Variable Definion)

 

The mc`s are in 13 levels.

 

How can i do that the same Code works for all mc`s that i choose?

 

The Code i use:

 

import com.greensock.*;
import com.greensock.easing.*;
import com.greensock.plugins.*;
TweenPlugin.activate([TintPlugin, GlowFilterPlugin]);

var buttons:Array = [katzen];
for (var i:int = 0; i< buttons.length; i++){
   buttons[i].addEventListener(MouseEvent.ROLL_OVER, over);
}

function over(e:MouseEvent):void {
   TweenMax.to(katzen, 1, {bezier:[{x:26, y:208}], tint:0x3366CC, ease:Bounce.easeOut});
}

 

Best Thanks.,.,.,

 

CHA :ugeek:

Link to comment
Share on other sites

I'm confused:

 

1) Why are you doing a Bezier tween with only one point? It defeats the purpose - it would be much more efficient to do a normal tween. In other words:

 

This:

TweenMax.to(katzen, 1, {bezier:[{x:26, y:208}], tint:0x3366CC, ease:Bounce.easeOut});

 

Gets the same result as this:

TweenMax.to(katzen, 1, {x:26, y:208, tint:0x3366CC, ease:Bounce.easeOut});

 

Normally Bezier tweens are for smoothly curving through multiple points along the way.

 

2) Why are you only populating your array with 1 value? Were you just simplifying it for posting online?

 

3) You didn't post all the code - there are no duplicate methods there. There must be a problem elsewhere in your code (it sounds like it has nothing to do with TweenLite/Max, though).

 

FYI, you don't need to activate the tint or glowFilter plugins if you're using TweenMax - it does it for you automatically. It doesn't hurt anything if you manually activate them too, though.

Link to comment
Share on other sites

Cheers.,.,.,

 

I will make it clear what i want to do:

 

i have 13 Menue Buttons, Movie Clip Buttons (bevor Text Links)...

Every Single Button is on a Level in ONE Flash Scene!

 

So what i will is, to put the Code:

import com.greensock.*;
import com.greensock.easing.*;
import com.greensock.plugins.*;

var buttons:Array = [regenbogenbruecke];
for (var i:int = 0; i< buttons.length; i++){
   buttons[i].addEventListener(MouseEvent.ROLL_OVER, over);
}

function over(e:MouseEvent):void {
   TweenMax.to(regenbogenbruecke, 0.3, {tint:0x3366CC, remove:true});
}

that works for 1 mc.,.,., into a next level, for another mc, in ONE Flash FLA!

But when i copy the Code to a Second mc in another Flash level.,.,., than it sucks!

It calls Double Name Definions, Double Function Definions!

The other mc Tweens are blocking then! Nothing works after! :roll:

 

Iam glad for help!

 

:cry:

 

CHA :ugeek:

Link to comment
Share on other sites

It sounds like the problem is that you're adding a bunch of functions to your timeline that all have the same name. Can't do that :)

 

Why don't you just use the target property of the MouseEvent and use that as the target of your tween. That way, you can reuse a single function.

 

import com.greensock.*;
import com.greensock.easing.*;
import com.greensock.plugins.*;

var buttons:Array = [regenbogenbruecke]; //put all your buttons in this Array
for (var i:int = 0; i    buttons[i].addEventListener(MouseEvent.ROLL_OVER, over);
}

function over(e:MouseEvent):void {
   TweenMax.to(e.target, 0.3, {tint:0x3366CC});
}

 

I'm also not sure why you had remove:true in your tween. What was your objective? The only place you can put a remove:true is inside a filter vars object, like blurFilter:{blurX:20, blurY:10, remove:true} which will cause the filter to be removed immediately after the tween completes.

Link to comment
Share on other sites

Hello Mr.Greensock,

 

that was my Problem, you find it!

Thanks alot :)

 

But i have another Question:

 

How can i do that the tint Effekt going away when i go with the Mouse out and to the next?

 

:geek:

 

CHA

Link to comment
Share on other sites

Add a ROLL_OUT handler.

 

var buttons:Array = [regenbogenbruecke]; //put all your buttons in this Array
for (var i:int = 0; i    buttons[i].addEventListener(MouseEvent.ROLL_OVER, over);
   buttons[i].addEventListener(MouseEvent.ROLL_OUT, out);
}

function over(e:MouseEvent):void {
   TweenMax.to(e.target, 0.3, {tint:0x3366CC});
}
function out(e:MouseEvent):void {
   TweenMax.to(e.target, 0.3, {tint:null});
}

Link to comment
Share on other sites

So how fast youre Answer :o

 

This Man makes me Happy.,.,., i think i begin to love you :mrgreen:

 

Many many Thanks for your Support!

You are the MAN!!! ~777~

 

Best wishes from Hamburg

 

CHA :ugeek:

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