PDA

View Full Version : speed control in flash movie


srinuseshu
06-28-2007, 02:04 PM
hi,

i have code for simple flash player . its working fine for playing '.swf' files . i want to put some enhancements to that.. previously i incuded one button and wrote some code for that. its also working fine. Now i want to include a comboBox with 4 options related to speed of movie
1) 1x ,2) 2x, 3) 3x , 4) 4x

needed functionalities:

1. when i select 2x, the movie play with 40 frames per second
2. when i select 3x, the movie play with 100 frames per second
3. when i select 4x, the movie play with 250 frames per second
4. when i select 1x, the movie play with 12 frames per second
(default frame rate).


i desined comboBox & wrote action script code and checked it with put some trace statements...its working fine .. means when i select any one of the options the trace statement inside that was displayed.

here the problem is how can i achieve above functionalities stated above??......... any idea?????



thank you in adv & srinu

plutocrat
06-28-2007, 02:12 PM
stage.frameRate:int sets the frame rate.

A word of warning; you may have trouble getting flash player to consistently run at 400fps.

panel
06-28-2007, 02:13 PM
stage.frameRate

srinuseshu
06-28-2007, 03:49 PM
if u dont mind plz tel me clearly how ca i use that command......... plz?? iam closely new one to action script

plutocrat
06-28-2007, 04:08 PM
stage.frameRate = 30

srinuseshu
06-29-2007, 06:45 AM
ya i used the command

stage.framerate = 200;

but i did not get any change in speed of movie ......



i wrote the code as following

if(combo.value == "3X")
{
trace("speed 3X is selected");
stage.frameRate = 200;
trace("frame rate = 200");
}


it displays in console as

speed 3x is selected
frame rate == 200

but movie did not effected




so any idea??


thank you in adv& srinu

srinuseshu
06-29-2007, 07:16 AM
i checked it with insert the following code also


trace("frame rate:"+stage.frameRate);


it displays
framerate: undefined


any mistake frm my side???


thank you in adv & srinu

icktoofay
06-29-2007, 07:17 AM
I think that stage.frameRate is read-only...
Edit: Scratch that. It's read-write.

srinuseshu
06-29-2007, 11:05 AM
i didn't get what you are saying......

wts readonly &read-write?? how can i edit that??


plz explain me in detail..............