Solved

multiple objects on the fly

Posted on 2000-04-04
9
145 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Embedding Flash App/Movie on Website 3 488
Google Chrome Blank White Screens 13 293
blocked plugin flash 5 111
Removing Flash from Website 6 45
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
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.

911 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