Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

multiple objects on the fly

Posted on 2000-04-04
9
148 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Text To Speech Reader For Adobe Flash Pages 4 930
Youtube video error 30 807
Adobe Flash Player - PPAPI plugin 6 712
Why is this simple, masked Flash animation flickering? 20 199
Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

860 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