Solved

multiple objects on the fly

Posted on 2000-04-04
9
144 Views
Last Modified: 2010-04-03
1)I have a simple form
2) I have a symbol (movie clip)

when the user types a number into the form and presses "Submit"
 like:
  ___
 |___|    How many do you want?

 Submit

it creates n... copies of the symbol. How can I do this? Oh by the way each movie clip will contain a row (array of variables) from an SQL query in my CGI script - that part I've got working believe it or not, heheh!

0
Comment
Question by:bobkatz
  • 5
  • 4
9 Comments
 
LVL 4

Accepted Solution

by:
RoyKruyshaar earned 200 total points
ID: 2686492
Hi Bobkatz,

Well, here we go.

Your movie clip must have a instance-name like 'mc' in my example.

Then, under the actions tab of your button the following script:

On (Release)
  Set Variable: "i" = "0"
    Loop While (i < n)
      Duplicate Movie Clip ("mc", "mc&i", i)
      Set Variable: "i" = i+1
    End Loop
End On

n is here the name of the textfield i used for the numer of movie-clips i want to create.
i is just a variable for counting the movieclips

Well, good luck with it, when you have further question, please feel free to ask.

Bye,

Roy
0
 
LVL 4

Expert Comment

by:RoyKruyshaar
ID: 2686531
Whoops, sorry, TypeMisMatch
This is the right code:

On (Release)
  Set Variable: "i" = "0"
  Loop While (i < n)
    Duplicate Movie Clip ("mc", "mc"&i, i)
    Set Variable: "i" = i+1
  End Loop
End On

Good luck again.

Roy
0
 

Author Comment

by:bobkatz
ID: 2687720
I was not able to get Flash instance properties actions box to accept - "mc"&i on line 4 of your example.

Thanks
0
 

Author Comment

by:bobkatz
ID: 2687728
I was not able to get Flash instance properties actions box to accept - "mc"&i on line 4 of your example.

Thanks
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:bobkatz
ID: 2687755
Ok - sorry had a little glich in the "On Release" statement - I didn't know it evaluated the enitire statement so I was missing a line =) I will try to get it to work now.

I should have told you that these clips need to stack one under the other. and so I guess I'll have to give each one a new x, y, offset yes?

I only have 200 points but they're yours once I get this running (probably worth more, hehe). Or-
can I award more pints than I have?
0
 
LVL 4

Expert Comment

by:RoyKruyshaar
ID: 2687806
The clips have all thge same coordinates.
You can change the coordinates by the following code:

On (Release)
  Set Variable: "Xas" = "0"
  Set Variable: "Yas" = "50"
  Set Variable: "i" = "0"
  Loop While (i < n)
    Duplicate Movie Clip ("mc", "mc"&i, i)
    Set Property ("mc"&i, X Position) = Xas
    Set Property ("mc"&i, Y Position) = Yas
    Set Variable: "Xas" = Xas+20
    Set Variable: "Yas" = Yas+20
    Set Variable: "i" = i+1
  End Loop
End On

Well, again good luck and thank you in advance for the points.
Please give me your url on GeneralFailure@Cheerful.com when you finished your project.
Well, again good luck and thank you in advance for the points.

Roy
0
 
LVL 4

Expert Comment

by:RoyKruyshaar
ID: 2696247
How are you doing so far? Any Questions?

Good Luck,

Roy
0
 

Author Comment

by:bobkatz
ID: 2704340
Adjusted points from 100 to 200
0
 

Author Comment

by:bobkatz
ID: 2704341
Yeah - I had some trouble getting back to my question area here. Couldn't locate the login screen. I work from about four machines but keeping my bookmarks up to date is still a challenge, hehheh. Here are the points (don't know how I get more but I'll cross that bridge . . .)

Oh yeah, also I was able to do it using the height of the movie clip for the Y offset. That way if I change the size later I don't have to recode that section and -  it's reuseable in another application! Kewl! I loooove Flash. HTML is officially dead! (Except as a wrapper!)

thanks again,

Rob
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now