A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Dynamic movie naming

  1. #1
    Hi all,
    i'm trying to create a number of duplicate movie clips using a for loop, managed to create them using dup clip and "opp"+n for the name, problem is trying to then access the new clips properties "opp"+n.value dosn't work at all...how can i access clips using a dynamic name?

    setproperty works o.k. with dynamic names but i want to set variables i have placed in the clip myself

    thx

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    Let's assume you duplicated the clip on _root.
    You can access the new instances like this:
    _root["opp"+n]._visible (or any other property)

    gparis

  3. #3
    Senior Member
    Join Date
    Apr 2000
    Location
    Minneapolis
    Posts
    2,127
    _root["opp" + n].MyVariable = 50;

    note no . before [
    you will need root or parent or something to start the path before the [] you cant just start with [] flash gets confused.

    mark

  4. #4
    yahoo!!.

    worked a treat, thanks guys

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