Groups | Blog | Home
all groups > flash actionscript > february 2004 >

flash actionscript : If statement help based on current frame


Stormpool
2/15/2004 4:15:05 PM
I have a movieclip, within this movie clip there are various frames, each is a
slight variation of the original.

We have empty, full, mouseover (so far

When empty the movie clip shows an image depicting an empty hol

When full it has a marble in i

When mouseover it shows a highlighted marble (for when the mouse is over the
image

I am struggling with the way to write the code for the movie clip so that

on (rollOver)
If this.frame is showing "full" then this.gotoAndStop( "mouseover"


And this code should not allow for the frame to change to "mouseover "if
originally it was "empty"

For those who are wondering it's in attempt to recreate the game 'solitaire'
from scratch in flash. (not the card game the marble one!

The bigger the task the more I learn

Help is much appreciated :o
stwingy
2/15/2004 4:27:14 PM
you could put on the "full" frame
stop();
this.onRollOver = function() {
gotoAndStop("mouseOver");
Stormpool
2/15/2004 4:55:11 PM
Didn't work properly, still affected the middle one (empty to start with).
although it's a nice idea to save me on duplicating code

I added the same type of thing to mouseover so it goes back to full after
rollout..

Any more ideas on the coding there

www.danielcook.com/solitaire.fl

for the source fil
stwingy
2/15/2004 5:32:25 PM
try this on the main timeline
for (i=1; i<8; i++) {
_root["d"+i].onRollOver = function() {
if (this._currentframe == 2) {
this.gotoAndStop("mouseover");
}
};
stwingy
2/15/2004 5:51:07 PM
or you could put this in the "empty" frame
Stormpool
2/15/2004 7:11:44 PM
www.danielcook.com/ammendsol.fl

It works now - thanks.. although having to put it in for each letter over and
out seems a bit mess

Is there a alphabetic count for an if statement

I tried changing the names of the holes to 13, 14, 15, 21, 22 etc instead of
A3 A4 A5.

but I couldn't get the statements to change them to full to work correctly,
don't know why.. hmm do you have to start with a letter
Stormpool
2/15/2004 8:17:47 PM
http://www.danielcook.com/solitaire.html

check out the music! hah - I think i've been avoiding something.. hmmmm

AddThis Social Bookmark Button