8 Replies Latest reply: Aug 27, 2006 8:50 PM by mapvnfx RSS

    [help] - Flash animation for i-mode mobile

    mapvnfx Community Member
      Hi! ^^

      I'm getting a trouble while creating a game for i-mode mobiles (DoCoMo)

      It works fine in Flash8 mobile simulator. But when I tested it in i-mode Simulator II, I got a (big) trouble:

      The animations perform not very slowly but when I hold down a key to move the character in the game, every animations are nearly stopped! only the character can move, and when it moves, all animations inside it are stopped too :(

      Everythings can only move again when I release the key :)

      Can anyone tell me how to solve this problem?

      ah, moreover, even when I hold down a key but let the flashplayer do nothing (i don't make the character move anymore and let all the movieclips work it own), the animations still slow down. It seem that the CPU spend too much time/power to process these keyevents :(

      Thanks ^o^
        • 1. [help] - Flash animation for i-mode mobile
          mapvnfx Community Member
          I created a simple animation and tested it in i-mode Simulator II, but I always meet this problem >.<

          see an example here:
          (it runs smoothly in flashplayer for PC, hic)

          www.freewebs.com/lungtung1_tmm/face.swf

          press 4 to move left, 6 to move right, press 5 to "do-nothing" ^^
          • 2. Re: [help] - Flash animation for i-mode mobile
            imodejon Community Member
            I think that the only function that you can do is onPress only. i dont think that it would continue to move ifyou keep pressing the key down. what code are you using?
            よろしく!
            ジョン
            • 3. Re: [help] - Flash animation for i-mode mobile
              mapvnfx Community Member
              i just use these codes (in my example):

              on (keyPress "5") {

              }
              on (keyPress "4") {
              if (/face:_x > 0)
              /face:_x -= 1;
              }
              on (keyPress "6") {
              if (/face:_x < 230 - /face:_width)
              /face:_x += 1;
              }

              quote:

              i dont think that it would continue to move ifyou keep pressing the key down

              did you mean that when creating the game for mobiles using FlashLite, we must press the key repeatly instead of holding the key down?

              thanks for your attention ^^
              • 4. Re: [help] - Flash animation for i-mode mobile
                imodejon Community Member
                Yes, i have tested it on our phones at our office and it seems not to work the way that you want it to. I dont think that there are any hardkeys for it to move that way.
                • 5. Re: [help] - Flash animation for i-mode mobile
                  mapvnfx Community Member
                  thanks for replying ^^

                  if there's no way to make it work as expected, i must change the game instead. uhm, seems a big trouble
                  • 6. Re: [help] - Flash animation for i-mode mobile
                    imodejon Community Member
                    // i toyed around with some codes and came up with this. see if this works on your 携帯.

                    on ("keyPress "1") {
                    dir = 1;
                    dirX = -1;
                    dirY = 0;
                    tellTarget ("target name") {
                    gotoAndPlay ("frame name");
                    }
                    }
                    on (keyPress "2") {
                    dir = 1;
                    dirX = 1;
                    dirY = 0;
                    tellTarget ("target name") {
                    gotoAndPlay ("frame name");
                    }
                    }

                    // etc.
                    // let me know if it works out for you!
                    • 7. Re: [help] - Flash animation for i-mode mobile
                      mapvnfx Community Member
                      yeah sure, it works fine :) That's also the way I solved my problem. Thanks again ^^

                      But I think this could be very complex in some kind of games. For example: a game that has a moving background (controled by AS, not just a simple animation), and while the background is moving, we need to make the characters move by pressing some keys.

                      In this case, when the key is pressed, I need to make all the objects move: background, characters,... So a piece of code must be placed in the keyevent handler's functions to control the moving of the backgorund. But it only be excuted when keypressed. So to make the background moves all the time, another copy of that code must be placed somewhere else.

                      -> There's some duplicated codes (do exactly the same work) excuted at the same time and they may cause some problem...

                      It's just how I solved my problem +_+
                      Maybe you have a greater idea ^^

                      Thanks for reading! (my English is not good, heh)
                      • 8. Re: [help] - Flash animation for i-mode mobile
                        mapvnfx Community Member
                        [quote]But I think this could be very complex in some kind of games. For example: a game that has a moving background (controled by AS, not just a simple animation), and while the background is moving, we need to make the characters move by pressing some keys.[/quote]

                        however, that's the problem of coding and it may have many solutions depends on how the game is. I have some others but they could work only for some specific game. Is there any way that solved the keyPress problem and work for all of these cases? ^^ Thanks