dcsimg
A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Can an instance name be a variable?

  1. #1
    Senior Member
    Join Date
    Jun 2002
    Location
    California
    Posts
    277

    Lightbulb

    I think I can solve one of my issues if I can put a variable in the box where you label the instance. I know you can call an instance name by a variable but can you actually put the variable in the label box?

    Thanks

  2. #2
    Developer
    Join Date
    Sep 2001
    Location
    The Bluegrass State Will Flash For Food
    Posts
    3,789
    I just tried it... yes

    Code:
    x_mc = y_mc;
    x_mc.onEnterFrame = function() {
    	this._x++;
    }
    that will move y_mc to the right...

  3. #3
    Developer
    Join Date
    Sep 2001
    Location
    The Bluegrass State Will Flash For Food
    Posts
    3,789
    the instance name of my movicelip was y_mc... no quotes

  4. #4
    Senior Member
    Join Date
    Jun 2002
    Location
    California
    Posts
    277
    sorry - I don't follow.

    I just noticed the code I need to assign an instance name to doesn't exist without code

    this.createEmptyMovieClip("box", 1000);
    box.loadMovie("test.swf");

    I would like to give box an instance name - is that possible - sorry I just am not getting the hang of actionscript yet.

    Are you saying just by typing

    box=car, I've given box an instance name?

  5. #5
    Developer
    Join Date
    Sep 2001
    Location
    The Bluegrass State Will Flash For Food
    Posts
    3,789
    Originally posted by boe_d
    this.createEmptyMovieClip("box", 1000);
    box.loadMovie("test.swf");
    sorry if i misunderstood you...

    in that case, box is the instance name of the loaded movie...

    don't delete your posts, it's not nice . makes me look like i'm talking to myself; it also confuses readers who are trying to follow the conversation

  6. #6
    Senior Member
    Join Date
    Jun 2002
    Location
    California
    Posts
    277
    Sorry - I deleted the post since I had bad information and it might lead you in the wrong direction. I was hoping to delete it before you saw it. Every time I ask a question, I find out the issue is more involved than I originally anticipated.

    Box is the instance name? I don't have to do any more than that?

    Wow - thanks.

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