I am producing a simple game that I want to flash 3 images when the game is won. From my understanding of fork and functions I thought I could pass the names of the images to the functions below so that the flash function is reusable.
Unfortunately I can't get it to work.
Anyone got any ideas?
// ======================== TO FLASH CORRECT OBJECTS
function MySetFlare(image1,image2,image3)
{
//Debug.trace(image1) This shows that the name of the image does get passed.
image1.SetFlare(6,6,0,RGB(255,0,0),5)
image2.SetFlare(6,6,0,RGB(255,0,0),5)
image3.SetFlare(6,6,0,RGB(255,0,0),5)
}
function MyRemoveFlare(image1,image2,image3)
{
image1.RemoveFlare()
image2.RemoveFlare()
image3.RemoveFlare()
}
function FlashWinner()
{
var Loop =1
while (Loop <100)
{
fork (MySetFlare)
wait (.2)
fork (MyRemoveFlare)
wait (.2)
Loop++
}
}
Regards
Clive Cartmel
Happy Christmas everyone!
|