Hi everyone !
I’m new here and wondered if my first post one some could help me out on…
I recently did the tutorial on here called “Keeping Score” - where you can click on one button and it will add score to a dynamic text field. Press another and it will subtract. I wanted to take this one step further - although have run into some problems.
I have set my stage up so that the MCcontainer loads up a random movie clip each time… from external SWF’s.
The idea was to have you click on the random swf’s when the pop up and add points… to the dynamic movie clip on the main stage. Although I end up getting a NaN in the score box…
However if I click on a button with the same script in the main movie (not externally) it will add to the score… and then if I click on the external movie it will add points correctly.
Here’s the code…
This is situated on the main movie
filename = [“tubetest.swf”, “tubetest2.swf”, “tubetest3.swf”];
i = filename.length;
k = Math.floor(Math.random()*i);
loadMovie(filename[k], movieTarget);
Which loads the random swf’s
The action script attached to the external swf button is this…
on (release) {
_root.total = _root.total + 100;
}
(The var for the score box is total)
I have made sure that it relates to the root - and it only works once a button has been pressed with the same code in the main timeline of the movie, but messes up if you click on the external SWF first.
Any help will be greatly appreciated - and hopefully teach me some more about Flash !
Thanks all
Johnnybaby