Solved

multiple objects on the fly

Posted on 2000-04-04
9
149 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
[X]
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
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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 last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

730 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