A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: tellTarget Varible

  1. #1
    Member
    Join Date
    Apr 2000
    Location
    Atlanta, GA
    Posts
    34
    I have a stop button that tells a movie clip to stop. The name of the movie clip is set by the variable "slide". Below is the action, which works fine if the stop button is in the main timeline.

    on (release) {
    tellTarget ((slide)) {
    stop();
    }
    }

    However if the button is in a different movie clip it does'nt work. Below is what I thought would be the answer but is NOT.

    on (release) {
    tellTarget (_root.(slide)) {
    stop ();
    }
    }

    I also tried it without any expresions, but no luck. Any items anyone?


  2. #2
    Member
    Join Date
    Apr 2002
    Posts
    49
    r u using flash4 / 5?
    if flash 5...
    try use _root.slide.stop();

    if flash 4...
    try use
    tellTarget ("../slide")...

    i not quite sure with flash 4...
    sorry

  3. #3
    Member
    Join Date
    Apr 2000
    Location
    Atlanta, GA
    Posts
    34
    Sorry I forgot... I'm using Flash MX, so flash 5 actionscript is OK.

    Thanks for the reply. Just to let you know "slide" is a variable, the actual movie clip name is movie_1, but there are serevral movie clips so the variable tells the stop action which on to stop.

    I tried your version:-

    on (release) {
    tellTarget _root.slide.stop();
    }


    Also tried:-

    on (release) {
    _root.slide.stop();
    }

    No luck I'm afraid. Any other suggestions?

  4. #4
    Senior Member chi-styler's Avatar
    Join Date
    Jul 2001
    Location
    Bristol, UK
    Posts
    1,237
    Hi,

    When targeting movie clip what you need to refer to is the name of that particular instance of a movie clip, I'm not not sure if this is what you're talking. If slide is the instance name of that movie clip on the main stage then

    on (release) {
    _root.slide.stop();
    }

    should work ok...

    Chi

  5. #5
    the indian sunmillennium's Avatar
    Join Date
    Nov 2000
    Location
    New Delhi INDIA
    Posts
    249

    eval

    try using 'eval' to get the final expression at runtime

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center