Groups | Blog | Home
all groups > flash (macromedia) > july 2005 >

flash (macromedia) : Random Movie clip Question! Help!


jcdesigns
7/13/2005 9:18:31 PM
I have two buttons in a timeline. When button 1 is clicked it replaces movie 1
with a random movie (all with names Symbol and a number). Button 2 is supposed
to do the same only for movie 2. The problem I'm having is when button 2 is
clicked, it removes the randomly placed movie in movie 1, and places a movie in
movie 2. I need them all to change and stay where they are. Please help!

Here is the code attached to button 1:

on (press) {
myNum = Math.floor(Math.random()*9)
myReaction = "Symbol " + myNum
trace(myReaction)
_root.attachMovie(myReaction,"myReaction_mc",0,{_x:106.4, _y:63.8})
}

Here is the code for button 2:

on (press) {
myNum2 = Math.floor(Math.random()*9)
myReaction2 = "Symbol " + myNum2
trace(myReaction2)
_root.attachMovie(myReaction2,"myReaction2_mc",0,{_x:236.4, _y:63.8})
}

What am I doing wrong?

Thanks,
Jeremy
coreysyms
7/14/2005 1:22:12 AM
_root.attachMovie(myReaction2,"myReaction2_mc", ---> 0 <-- ,{_x:236.4,
_y:63.8})

the 0 (zero) is messing you up... it is the depth level to place your
movieClip or swf leave it out or make myReaction2 = 1 or higher.

you can't have 2 clips on the same depth level.. flash will remove and insert
the latest clip in its place.

good luck

corey
AddThis Social Bookmark Button