Solved

multiple objects on the fly

Posted on 2000-04-04
9
147 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
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 

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
 

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
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.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

809 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