A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: tellTarget versus With etc.

  1. #1
    Member
    Join Date
    Nov 2001
    Posts
    55

    resolved

    I am using following script:

    _root.mc = new Array();
    i = 3;
    _root.e = _root.n.firstChild;
    while (_root.e != null) {
    mc[i] = "tab"+i;
    attachMovie("MCprod_tab", mc[i], i);

    tellTarget (mc[i]) {
    caption = "";
    _x = _root.first_col;
    _y = _root.first_line;
    gotoAndStop (1);
    }

    i = i+1;
    _root.e = _root.e.nextSibling;
    }

    which loops through xml document and attaches new instance of MCprod_tab for every node it founds and then sets up some parameters of it according to data stored in xml document (like position of current instance, dynamic text displayed etc.). It works. But since the tellTarget is deprecated, I am curious whether I can do the same thing using with() - I was not succesfull so far.

  2. #2
    Just use a series of actions formated with dot syntax.

    mc._x = _root.first_col;


    etc...

  3. #3
    Junior Member
    Join Date
    Jul 2002
    Posts
    29
    with() should work the same way as tellTarget() and is recommended when running multiple actions to the same mc. Try playing around with the targeting of the movieclip. I know that back in flash 5 I sometimes got errors about generator when I was in normal editing mode, don't know if they've fixed that for MX

  4. #4
    Member
    Join Date
    Nov 2001
    Posts
    55
    to Miggs: Thank you, but your advice is not usable. If you study my script, than you see, that I dynamically create an array by "while" loop which stores instance names of clips attached to the scene by the same loop. Then the names of instances are: tab1, tab2... and are stored in array fields mc[1], mc[2]...
    Number of attached clips is not fixed - it depends on loaded XML document.
    Another problem is, that inside my tellTarget command I use a lot of other commands (I simplified the script here), so I must use either tellTarget or with().
    To DanCarrey: I have a clue, where the problem is: with() command "do not understand" this: with(mc[i]) (in tellTarget I use tellTarget(mc[i]) and it is O.K.)

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