[Tweener] FW: AS 3 If/Else issues with Tweener - Part two

Makc makc.the.great at gmail.com
Thu Nov 13 01:41:54 PST 2008


set linkage params for pink button in library

On Thu, Nov 13, 2008 at 11:17 AM, Nathan Thompson
<nathan.thompson at engagegroup.co.uk> wrote:
>
> Hey all. Thanks very much to Gerry (props for the sample movie) and Cedric
> for their help.
>
> I have managed to get it to work! BUT... And this is the last time you hear
> about if because if I can't fix this I may have to resort to timelining
> (shudder).
>
> I have the following working great.
>
>
> var blue:MovieClip = new BlueBtn();
> blue.x = 166;
> blue.y = 23;
> blue.addEventListener(MouseEvent.MOUSE_UP,moveBtn);
> // if you want a hand cursor
> blue.buttonMode = true;
> blue.useHandCursor = true;
> addChild(blue);
> //
> function moveBtn(e:MouseEvent):void {
>     var btn = e.target;
>     if (btn.x == 166) {
>         Tweener.addTween(btn, {x:638, time:1});
>         Tweener.addTween(blue_content_MC, {x:166, time:1});
>     } else if (btn.x == 638) {
>         Tweener.addTween(btn, {x:166, time:1});
>         Tweener.addTween(blue_content_MC, {x:-311, time:1});
>     }
> }
>
>
> What I assumed was that to re-create that for 6 other elements (pink, grey,
> yellow etc...) I would copy/paste then swap out the mentions of blue for the
> colour required (all movie clips are named the same format)
>
> But I get this...
> 1021: Duplicate function definition. function moveBtn(e:MouseEvent):void {
>
> So I change the function to movePinkBtn
>
> And I get...
> 1180: Call to a possibly undefined method PinkBtn. var pink:MovieClip = new
> PinkBtn();
>
>
> Anyhoo – files are at http://www.mymindseye.co.uk/tween/tween.zip if anyone
> fancies a look.
>
> Thanks again people.
>
> ------ End of Forwarded Message
>
> _______________________________________________
> Tweener mailing list
> Tweener at lists.caurinauebi.com
> http://lists.caurinauebi.com/listinfo.cgi/tweener-caurinauebi.com
>
>


More information about the Tweener mailing list