A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Var not working

  1. #1
    Member
    Join Date
    Aug 2003
    Location
    orange county, ca
    Posts
    42

    Var not working

    --

    So, I’ve got this ---> _name+VarBob

    It’s supposed to return the MC name and whatever “VarBob” is. In my case, “VarBob” is a dot extension that I would like to define at a different time and place.

    Ideal outcome ---> MCname.swf or MCname.jpg

    when I define VarBob locally it works…

    Like this ---> VarBob=”.swf”

    But I want to define VarBob somewhere else

    Like this ---> _root.menu.whatever.VarBob=”.swf”

    I get this ---> MCname not this MCname.swf


    Any ideas?


    --

  2. #2
    The Flashman earl223's Avatar
    Join Date
    Sep 2000
    Location
    Marikina City, Philippines
    Posts
    876
    Like you said, it's works locally but not after adding a path... maybe your targetting is off.
    i eat actionscripts for breakfast

  3. #3
    Member
    Join Date
    Aug 2003
    Location
    orange county, ca
    Posts
    42
    no thats not it. i am successfuly targeting other vars in the same spot from different places.

  4. #4
    Member
    Join Date
    Aug 2001
    Posts
    53
    If I understand your problem correctly, you just need to use:

    _name + _root.menu.whatever.VarBob=”.swf”

  5. #5
    Member
    Join Date
    Aug 2003
    Location
    orange county, ca
    Posts
    42
    --

    i want to define "VarBob" on the main time line...

    _root.menu.whatever.VarBob=”.swf”


    inside my MC "whatever" i have this

    _name+VarBob

    which should return this

    whatever.swf

    but i get

    whatever (without the .swf)

    --

  6. #6
    Member
    Join Date
    Aug 2001
    Posts
    53
    So basically you want to define a variable that is local to the movie clip from someplace outside the movie clip? Do you not know the movie clip's name? How was the movie clip created? Manually? Dynamically?

  7. #7
    Member
    Join Date
    Aug 2003
    Location
    orange county, ca
    Posts
    42
    --

    so my "whatever" MC is named dinamicly... (im a bone head)

    so here is my solution

    i am defining it localy baced on the _parent._name using an if else...

    stop();
    if (_parent._name == "MC1") {
    extns=".jpg";
    } else if (_parent._name == "MC2") {
    extns=".swf";
    }
    this.x = getProperty(this, _name);
    this.but.onRelease = function() {
    loadMovie("bob/"+_name+extns, "_root.loadin");
    _parent.gotoAndStop(1);
    };

    --

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