A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [CS3] 2 Questions??

  1. #1
    1337Phantom-I
    Join Date
    Jun 2008
    Location
    My World!
    Posts
    25

    Question [CS3] 2 Questions??

    Hello Everybody (First Post), I have a few questions and I'll be glad if they'll be answered.

    I have Flash Professional CS3 and I am not totally new too flash (I know the basics, animations, and some actionscript 2)...

    So here are the questions:

    1. At the beginning you set the "Width," "Height" and "FPS;" well for example when 10 frames pass is there a way to change the W, H and FPS in those next 10 frames? Hope you understand because it may sound confusing; I want to change the Height, Width and FPS in the middle of the movie; is this possible?

    2. Well Ok, I know how to make a character move with controls being the arrow keys; But I want to make him move using keys "W,S,A,D." Here's my code for this:

    onClipEvent (load) {
    root.up
    root.down
    root.left
    root.right

    XSpeed = 6;
    }

    onClipEvent (enterFrame) {
    if (Key.isDown(Key.UP) && _root.up == true) {
    _rotation = 270;
    _y-= XSpeed;
    }
    if (Key.isDown(Key.DOWN) && _root.down == true) {
    _rotation = 90;
    _y+= XSpeed;
    }
    if (Key.isDown(Key.LEFT) && _root.left == true) {
    _rotation = 180;
    _x-= XSpeed;
    }
    if (Key.isDown(Key.RIGHT) && _root.right == true) {
    _rotation = 0;
    _x+= XSpeed;
    }
    }



    Thank you for taking your time too read this...

  2. #2
    1337Phantom-I
    Join Date
    Jun 2008
    Location
    My World!
    Posts
    25
    Bump

  3. #3
    Senior Member onine's Avatar
    Join Date
    Mar 2005
    Posts
    627
    1) you can't change the dimensions of the stage or the frame rate of the movie during the movie I'm afraid.

    One solution would be to load the movie in question into another movie and scale it up or down from there. Obviously, this makes the size of the movie bigger and smaller and also all of the graphics inside it will scale up/down too.

    You could of course use a larger stage size and just change the size of the ‘frame’ around your graphics.

    There is no way to change the fps of a movie except by loading it into another movie with a different fps (the loaded movies inherit the fps from the parent).

    2) As for the code, try this:

    Code:
    onClipEvent (load) {
    root.up
    root.down
    root.left
    root.right
    
    XSpeed = 6;
    }
    
    onClipEvent (enterFrame) {
    if (Key.isDown(87) && _root.up == true) {
    _rotation = 270;
    _y-= XSpeed;
    }
    if (Key.isDown(83) && _root.down == true) {
    _rotation = 90;
    _y+= XSpeed;
    }
    if (Key.isDown(65) && _root.left == true) {
    _rotation = 180;
    _x-= XSpeed;
    }
    if (Key.isDown(68) && _root.right == true) {
    _rotation = 0;
    _x+= XSpeed;
    }
    }
    hope that helps

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center