A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: Help! with the with action...

  1. #1
    human
    Join Date
    May 2000
    Posts
    132

    Help! with the with action...

    I am using FlashMX.
    I am readjusting to the 'with' action and I am having problems targeting from within nested MC's.
    Here's the situation:
    _root.floor_2.unit207W

    this is the path and inside unit207W there is a button.
    When clicked, I need it to go to a new scene.

    I have this as my code, and it does not work....
    The trace I set up after the path works, but it does not go to the new scene...

    on (release) {
    with (_root.floor_2.unit_207W) {
    gotoAndPlay("unit_207W",1);
    }
    }

    Am I even doing this right to begin with? Or is there another way????

    HELP!!!!!

    Thanks in advance!

  2. #2
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    Code:
    on (release) { 
    _root.floor_2.unit_207W.gotoAndPlay("unit_207W",1); 
    }
    should be the quickest way.

    first of all, don't use "_" not "-" with instance names

    then, read
    this thread on scenes
    Last edited by nunomira; 11-25-2002 at 03:42 PM.

  3. #3
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    the "with" is mainly used when multiple action target only one movieclip. If you have only one command you so not really need it.
    All the "goto scene" has been covered a lot in this forum. And the result is that it is better in all cases to use labels instead of scene names and frame numbers which most of the time only work when called and executed from the same timeline.

    so this should work better:
    _root.floor_2.unit_207W.gotoAndPlay("label");

    Now, even, if this action is calle from that timeline (you said the button was inside "_root.floor_2.unit_207W")
    this should be enough:
    this.gotoAndPlay("label");
    or
    gotoAndPlay("label");

    gparis

  4. #4
    half as fun, double the price senocular's Avatar
    Join Date
    Feb 2002
    Location
    San Francisco, CA (USA)
    Posts
    4,361
    Originally posted by nunomira

    first of all, don't use _ not - with instance names
    ?

  5. #5
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003


    is this supposed to work?

    _root.mymc-1.gotoAndStop(2);

    and I've had problems with "_" the first and only time I used it.

    there is something like a "white paper" which mentions that.

    or would you like to explain better your idea?

  6. #6
    half as fun, double the price senocular's Avatar
    Join Date
    Feb 2002
    Location
    San Francisco, CA (USA)
    Posts
    4,361
    I didnt see any "-"s in the original path and you left off (which I now assume to be a typo) the "_" in _root, which is what I thought that quote was refering to, the "-" just being a part of the grammar extending your sentance...


  7. #7
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    that was definitely a typo!
    and the lack of quotes, lazyness!

  8. #8
    human
    Join Date
    May 2000
    Posts
    132
    it works, but are you saying not to use underscores ("_") in instance names?

  9. #9
    half as fun, double the price senocular's Avatar
    Join Date
    Feb 2002
    Location
    San Francisco, CA (USA)
    Posts
    4,361
    it was about using "-" in instant names, not "_"
    underscores are fine, dashes shoulf be avoided.

  10. #10
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003

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