(FMX)/(F5) simple question

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!!!:slight_smile:

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!

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.

*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

It definately works, I tested it out. Are you sure you gave the correct instance name ?

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


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.
:slight_smile:

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

That’s funny, I did the exact same but it works for me.

ummm can you send me a file in Flash 5 fromat. unexpected ile format warning.

Thanks again

The [font=courier new]setInterval[/font] function is not supported in Flash 5! :stuck_out_tongue:

You’ll need to use an [font=courier new]onClipEvent (enterFrame)[/font] handler:

onClipEvent (enterFrame) {
this._visible = !this._visible;
}

And welcome to kirupa forum, by the way. =)

finally.

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

Yep, you’d need to increase the FPS. :slight_smile:

And no problem. :wink:

This was Flash 5 !? How could I know ? (FMX)/(F5) doesn’t say much if it’s FMX or F5 … :stuck_out_tongue: