Results 1 to 6 of 6

Thread: Button's script, target not found?

  1. #1

    Button's script, target not found?

    Hey everyone. I'm using cs5.5 with as2 and i'm facing this strange problem:

    i have a movieclip (test_main) on root with 2 movieclips (test_mc & test_btn) inside.
    At frame 1 of test_main i'm writing:
    Code:
    stop();
    
    test_btn.onRollOver = function()
    {
        tellTarget (_parent.test_mc)
        {
            gotoAndPlay(2);
        }
    };
    test_btn.onRollOut = function()
    {
        tellTarget (_parent.test_mc)
        {
            gotoAndPlay(11);
        }
    };
    ..and i get
    Code:
    Target not found: Target="undefined" Base="_level0.test_main"
    Same with _parent.test_mc.gotoAndPlay ..no movement.
    I've been using this hundred of times back in Flash8 without a tiny problem.. but this one is driving me crazy now..

    Thanks in advance!

  2. #2
    i have a movieclip (test_main) on root with 2 movieclips (test_mc & test_btn) inside.
    Have you tried _root.test_main.test_mc?

  3. #3
    TheCanadian's Avatar
    10,286
    posts
    Noo doot aboot it, eh?
    Or just test_mc?
    Proud Montanadian
    We tolerate living and breathing. And niches.

    Name Brand Watches

    Maybe getTimer() or TweenMax is the answer to your problem . . .

  4. #4
    Yeah.. test_mc, _root.test_main.test_mc, _parent.test_mc, _level0.test_main.test_mc even with _lockroot ... everything fails.

  5. #5
    Why you need to use tellTarget? It is deprecated.
    Remove tellTarget code line and simply use gotoAndPlay(2) for same movieclip
    and _parent.gotoAndPlay(2) / _root.gotoAndPlay(2) for root

  6. #6
    Bah, i figured it out..

    Code:
    stop();
    
    function rOver(mc:MovieClip)
    {
        // _root.test_main.mc.gotoAndPlay : is what i was trying to pass... which was failing
        mc.gotoAndPlay(2);
    }
    function rOut(mc:MovieClip)
    {
        mc.gotoAndPlay(11);
    }
    
    
    test_btn.onRollOver = function()
    {
        rOver(test_mc); // this actually returns "_level0.test_main.test_mc" instead of just "test_mc"
    };
    test_btn.onRollOut = function()
    {
        rOut(test_mc);
    };

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012