PDA

View Full Version : (FMX)/(F5) simple question



doobie
November 11th, 2003, 09:23 AM
lets sy i have a movie with a black backgound with a white dot in the center. how do i make this dot invisible then visible again sort of flashing on and off using action script. i want it to be fast by the way.

thanks!!!!:)

Laslett
November 11th, 2003, 09:48 AM
have a movie that has two frames that will just keep on running over and over

frame 1 property .root.dot.visible = 1
frame 2 properyy .root.dot.visible =0

or the dot movie has 1 frame with the dot and one without!

Voetsjoeba
November 11th, 2003, 09:54 AM
Place this on the timeline your movieclip is in:



swap = function() {
mc._visible = !mc._visible;
};
vis = setInterval(swap,150)

You can control the speed by changing 150 ms to a lower or higher value.

doobie
November 12th, 2003, 09:09 PM
Originally posted by Voetsjoeba
Place this on the timeline your movieclip is in:



swap = function() {
mc._visible = !mc._visible;
};
vis = setInterval(swap,150)

You can control the speed by changing 150 ms to a lower or higher value.

It doesn't seem to eork. both suggestions

Voetsjoeba
November 13th, 2003, 02:22 PM
It definately works, I tested it out. Are you sure you gave the correct instance name ?

doobie
November 14th, 2003, 09:56 AM
okay. in the script you wote as a sample which one there is the instance name of the movie clip? and should the script be plced on the mc itself or in the timeline?

thanks

Voetsjoeba
November 14th, 2003, 01:17 PM
swap = function() {
mc._visible = !mc._visible;
};
vis = setInterval(swap,150)


mc is the name of the movieclip. The script should be placed on the timeline in which mc is in.
:)

doobie
November 14th, 2003, 09:21 PM
i'm uisng flash . it's still not woking? what am i doing wong

first a ceted new document then insert>new symbol>movieclip. I ust daw a simple box. i place the movie clip on my main stage gave it an instance name "mc" then i put the actins on the first frame of my timeline? i test it and nothing happned

Voetsjoeba
November 15th, 2003, 03:32 AM
That's funny, I did the exact same but it works for me.

doobie
November 15th, 2003, 11:37 PM
ummm can you send me a file in Flash 5 fromat. unexpected ile format warning.

Thanks again

kode
November 16th, 2003, 02:46 AM
The setInterval function is not supported in Flash 5! :P

You'll need to use an onClipEvent (enterFrame) handler:

onClipEvent (enterFrame) {
this._visible = !this._visible;
}
And welcome to kirupa forum, by the way. =)

doobie
November 16th, 2003, 02:55 AM
finally.

thanks. i guess i just hve to increase fps to make it faster

kode
November 16th, 2003, 03:00 AM
Yep, you'd need to increase the FPS. :)

And no problem. ;)

Voetsjoeba
November 16th, 2003, 05:30 AM
This was Flash 5 !? How could I know ? (FMX)/(F5) doesn't say much if it's FMX or F5 ... :P

kode
November 16th, 2003, 01:17 PM
Well... yeah, it is kinda confusing. :P