Help With object movment
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Help With object movment

  1. #1
    Junior Member
    Join Date
    Sep 2012
    Posts
    3

    Help With object movment

    Hi I'm fairly new to Swishmax, my current version if Swishmax 3. I wanted to try something simple;
    Moving an object w/ arrow keys, or any key. I saw some guides on swishzone and some other crappy sites, but itwas all for Swish1.

  2. #2
    Carpe Diem - Moderator wolfgross's Avatar
    Join Date
    Apr 2001
    Location
    SWiSHzone
    Posts
    1,698
    ...it doesn't matter if it's for SWiSH Max1 or SWiSH Max3 - the action is still the same -

    on (keyPress("<Space>")) {
    }
    on_keypress.jpg



    wolf
    Last edited by wolfgross; 09-18-2012 at 08:50 PM.

  3. #3
    Carpe Diem - Moderator wolfgross's Avatar
    Join Date
    Apr 2001
    Location
    SWiSHzone
    Posts
    1,698
    ...here's a swi the works on the space key -
    on_keypress.swi

    wolf

  4. #4
    Junior Member
    Join Date
    Sep 2012
    Posts
    3
    See, thats what the hell I thought, seen many many guides on this same thing, saying the same thing.

    Basically I created a square, have in different SWI's grouped it as a movie clip, & converted to movie clip, and added this code

    on (keyPress("<Up>")) {
    face._Y -= 20}
    on (keyPress("<Down>")) {
    face._Y += 20}
    on (keyPress("<Left>")) {
    face._X -= 20}
    on (keyPress("<Right>")) {
    face._X += 20}

    And absolutely nothing

  5. #5
    Junior Member
    Join Date
    Sep 2012
    Posts
    3
    Ok. Now this is weirding me out a bit. I tried reimplenting this code:

    on (keyPress("<Up>")) {
    face._Y -= 20}
    on (keyPress("<Down>")) {
    face._Y += 20}
    on (keyPress("<Left>")) {
    face._X -= 20}
    on (keyPress("<Right>")) {
    face._X += 20}

    It doesn't work, i accidentally clicked the "up function" to the object, not the parent. The up function doesn't work but all three others work, down, left, right. I change the up function back to parent, and the whole thing doesn't work. Strange

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

Poll by Flashkit.com