Orientation of the player

I'm making a game and I've got my player who can go the right or to the left. The orientation of the player is defined in my Player class. The method gets called constantly while the player is in motion and it just switches the player’s orientation instantly when it needs to.
It works juste fine :
private function orientPlayer():void{
    // Make sure the player is pointed in the right direction
    if (xinc < 0 && scaleX > 0){
        scaleX = -scaleX;
    if (xinc > 0 && scaleX < 0){
        scaleX = -scaleX;
But, now I'm trying to put a transition between the "going right" and "going left" (create an animation of the turning side to side while moving).
I’ve created the turning-around animation for the character, and put that animation into a frame on the character’s main timeline with a frame name of “turn”, just like I've already have for “walk,” “talk”, and “grab.” In this movieclip I ve got an action placed on its final frame : stop(); dispatchEvent(new Event("clipFinished"));
Than I've changed my orientation method so that it stops the walking animation and movement, turns the character around, and then resumes the movement. It dit that :
private function orientPlayer():void{
// Make sure the player is pointed in the right direction
var dummyEvent:Event;
if (xinc < 0 && scaleX > 0){
stopWalking(dummyEvent);
gotoAndStop("turn");
// I have in my movie clip dispatch the "clipFinished" event
stageRef.addEventListener("clipFinished", resumeWalking);
if (xinc > 0 && scaleX < 0){
stopWalking(dummyEvent);
gotoAndStop("turn");
stageRef.addEventListener("clipFinished", resumeWalking);
And then I've added a resumeWalking method like so:
private function resumeWalking():void{
scaleX = -scaleX;
startWalking(targetX, targetY);
The problem : My player can now only go to the left. When I'm clicking to the right, my player goes to the frame "turn" and stays in this position... But If I'm clicking to the left, it's working (the "turn" position stops and he walks.)
Do you know why my player can only go to the left ?
Thank you !

Use the trace function to see how the conditionals are getting processed.  The way you have that function written could be rewrtitten to one conditional since they both do the same thing.  You might need to figure out whether you want to go with scaleX versus -scaleX, and assign a value of 1 versus -1 instead of just changing it to be the opposite all the time.
private function orientPlayer():void{
    if ((xinc < 0 && scaleX > 0) || (xinc > 0 && scaleX < 0)){
        scaleX = -scaleX;

Similar Messages

  • Cannot see control options in the player

    I have downloaded a free trail version of macromedia flash 6
    on windows machine .whenever i try to open flash movie(.swf) from
    the player , the movie is played but i cannot see the control
    buttons with the movie .

    hi
    i was able to add control button like play ,pause ,stop with
    the movie but i want to present player like layout with the movie
    .I am trying to get the player layout like the one we use to get
    while watching video on net.The basic idea is to inform the viewer
    about the duration of the movie .
    Any idea???

  • "The version of the Player that you are trying to install is lower than what is currently installed" when installing 14.0.0.176

    I've been deploying flash updates thru SCCM for a long time using the MSI.  With this update, many computers updated successfully, but about 200+ of them failed.  Each computer I have looked at has the message "Product: Adobe Flash Player 14 ActiveX -- The version of the Player that you are trying to install is lower than what is currently installed." in event viewer.  Attempting a manual install of the MSI produces a similar interactive message.  The current installed version is definitely older than the one I am attempting to install.  I am only able to re-mediate by manually uninstalling, and then installing 14.0.0.176.  I could script and deploy an uninstaller, but I would rather the bug with the MSI be fixed.

    Dear María,
    Finally, I have been able to reproduce the error, both in ActiveX and plugin installers updating from version 15.0.0.246.
    Here you have the logs:
    ACTIVEX
    === Verbose logging started: 18/12/2014  16:12:54  Build type: SHIP UNICODE 5.00.7601.00  Calling process: C:\WINDOWS\system32\msiexec.exe ===
    MSI (c) (E0:1C) [16:12:54:137]: Resetting cached policy values
    MSI (c) (E0:1C) [16:12:54:137]: Machine policy value 'Debug' is 0
    MSI (c) (E0:1C) [16:12:54:137]: ******* RunEngine:
               ******* Product: install_flash_player_16_active_x.msi
               ******* Action:
               ******* CommandLine: **********
    MSI (c) (E0:1C) [16:12:54:138]: Client-side and UI is none or basic: Running entire install on the server.
    MSI (c) (E0:1C) [16:12:54:138]: Grabbed execution mutex.
    MSI (c) (E0:1C) [16:12:54:155]: Cloaking enabled.
    MSI (c) (E0:1C) [16:12:54:155]: Attempting to enable all disabled privileges before calling Install on Server
    MSI (c) (E0:1C) [16:12:54:158]: Incrementing counter to disable shutdown. Counter after increment: 0
    MSI (s) (30:E4) [16:12:54:162]: Running installation inside multi-package transaction C:\WINDOWS\system32\install_flash_player_16_active_x.msi
    MSI (s) (30:E4) [16:12:54:162]: Grabbed execution mutex.
    MSI (s) (30:4C) [16:12:54:163]: Resetting cached policy values
    MSI (s) (30:4C) [16:12:54:163]: Machine policy value 'Debug' is 0
    MSI (s) (30:4C) [16:12:54:163]: ******* RunEngine:
               ******* Product: C:\WINDOWS\system32\install_flash_player_16_active_x.msi
               ******* Action:
               ******* CommandLine: **********
    MSI (s) (30:4C) [16:12:54:163]: Note: 1: 2203 2: C:\WINDOWS\system32\install_flash_player_16_active_x.msi 3: -2147287038
    MSI (s) (30:4C) [16:12:54:164]: MainEngineThread is returning 2
    MSI (s) (30:E4) [16:12:54:177]: User policy value 'DisableRollback' is 0
    MSI (s) (30:E4) [16:12:54:178]: Machine policy value 'DisableRollback' is 0
    MSI (s) (30:E4) [16:12:54:178]: Incrementing counter to disable shutdown. Counter after increment: 0
    MSI (s) (30:E4) [16:12:54:178]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Rollback\Scripts 3: 2
    MSI (s) (30:E4) [16:12:54:178]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Rollback\Scripts 3: 2
    MSI (s) (30:E4) [16:12:54:178]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\InProgress 3: 2
    MSI (s) (30:E4) [16:12:54:178]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\InProgress 3: 2
    MSI (s) (30:E4) [16:12:54:178]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied.  Counter after decrement: -1
    MSI (s) (30:E4) [16:12:54:178]: Restoring environment variables
    MSI (c) (E0:1C) [16:12:54:188]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied.  Counter after decrement: -1
    MSI (c) (E0:1C) [16:12:54:188]: MainEngineThread is returning 2
    === Verbose logging stopped: 18/12/2014  16:12:54 ===
    PLUGIN
    === Verbose logging started: 18/12/2014  16:15:40  Build type: SHIP UNICODE 5.00.7601.00  Calling process: C:\WINDOWS\system32\msiexec.exe ===
    MSI (c) (28:44) [16:15:40:364]: Resetting cached policy values
    MSI (c) (28:44) [16:15:40:364]: Machine policy value 'Debug' is 0
    MSI (c) (28:44) [16:15:40:364]: ******* RunEngine:
               ******* Product: install_flash_player_16_plugin.msi
               ******* Action:
               ******* CommandLine: **********
    MSI (c) (28:44) [16:15:40:364]: Client-side and UI is none or basic: Running entire install on the server.
    MSI (c) (28:44) [16:15:40:364]: Grabbed execution mutex.
    MSI (c) (28:44) [16:15:40:384]: Cloaking enabled.
    MSI (c) (28:44) [16:15:40:384]: Attempting to enable all disabled privileges before calling Install on Server
    MSI (c) (28:44) [16:15:40:384]: Incrementing counter to disable shutdown. Counter after increment: 0
    MSI (s) (30:2C) [16:15:40:384]: Running installation inside multi-package transaction C:\WINDOWS\system32\install_flash_player_16_plugin.msi
    MSI (s) (30:2C) [16:15:40:384]: Grabbed execution mutex.
    MSI (s) (30:3C) [16:15:40:384]: Resetting cached policy values
    MSI (s) (30:3C) [16:15:40:384]: Machine policy value 'Debug' is 0
    MSI (s) (30:3C) [16:15:40:384]: ******* RunEngine:
               ******* Product: C:\WINDOWS\system32\install_flash_player_16_plugin.msi
               ******* Action:
               ******* CommandLine: **********
    MSI (s) (30:3C) [16:15:40:384]: Note: 1: 2203 2: C:\WINDOWS\system32\install_flash_player_16_plugin.msi 3: -2147287038
    MSI (s) (30:3C) [16:15:40:384]: MainEngineThread is returning 2
    MSI (s) (30:2C) [16:15:40:404]: User policy value 'DisableRollback' is 0
    MSI (s) (30:2C) [16:15:40:404]: Machine policy value 'DisableRollback' is 0
    MSI (s) (30:2C) [16:15:40:404]: Incrementing counter to disable shutdown. Counter after increment: 0
    MSI (s) (30:2C) [16:15:40:404]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Rollback\Scripts 3: 2
    MSI (s) (30:2C) [16:15:40:404]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Rollback\Scripts 3: 2
    MSI (s) (30:2C) [16:15:40:404]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\InProgress 3: 2
    MSI (s) (30:2C) [16:15:40:404]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\InProgress 3: 2
    MSI (s) (30:2C) [16:15:40:404]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied.  Counter after decrement: -1
    MSI (s) (30:2C) [16:15:40:404]: Restoring environment variables
    MSI (c) (28:44) [16:15:40:414]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied.  Counter after decrement: -1
    MSI (c) (28:44) [16:15:40:414]: MainEngineThread is returning 2
    === Verbose logging stopped: 18/12/2014  16:15:40 ===

  • How can I use two different page orientations in the same document?

    I am trying to have both portrait and landscape page orientations in the same document.  Pages doesn't seem to like this.  Is there a way?

    I tried to comment on another thread about this same issue, but the thread was closed.
    In the other thread; however, some asked why rotating one pages was necessary, and if they knew then maybe there would be reason to create the function.
    Well, I don't know about why anyone else needs it, but for me it's for the papers I have to write for my masters program. The professors like to have the rubric attached to the bottome of the document so they easily grade and keep things organized. They of course give directions on how to easily change the orientation of the last page in Word, but not all of use Word, or even want to use Word. Maybe I need to ditch Pages and go to Word? I'd really hate to do that!
    So, come on Apple, let's get this feature added, stat!

  • I am running IE 11 on Windows 7 Home Premium 64 Bit Service Pack 1. When I attempt to install Flash Player, it goes through all of the steps, tells me the player is installed, and welcomes me. I cannot open the player and it does not appear in the Start M

    I am running IE 11 on Windows 7 Home Premium 64 Bit Service Pack 1. When I attempt to install Flash Player, it goes through all of the steps, tells me the player is installed, and welcomes me. I cannot open the player and it does not appear in the Start Menu, Task Manager, System Tray, or anywhere else. When I try to open a file, the site tells me Flash player is not installed. I have even downloaded it to a separate folder and ran the install with IE shut down completely. And Shockwave in ENABLED but in 32 bit .I have been trying to get this to work for about 3 weeks now.  HELP!!!

    Flash Player is a browser add-on, not an executable program.
    If you need to open a local SWF file you will need the standalone player (Projector) from http://www.adobe.com/support/flashplayer/downloads.html
    Note that the download is the player, not an installer, so you will need to make the file association manually.

  • I have a iMac version 10.6.8 and used to have adobe flash player my laptop requires me to download the latest version of the player but warns me that there is a "risk" downloading from the internet. Anyone else experienced this and may have some solutions

    I have a iMac version 10.6.8 and used to have adobe flash player my laptop requires me to download the latest version of the player but warns me that there is a "risk" downloading from the internet. Anyone else experienced this and may have some solutions

    Install it directly from Adobe. Ensure that you use the uninstaller before installing.

  • How to see the multi bit rate streaming on the player

    Hi.
    I am using flash media server 4.5 .
    I am able to stream rtmp as well as http streaming.
    Now i want so stream multibitrate streaming. i am able to send the stream to the server, but i don't know how to acess it on the player.
    I want to know that is there any flash var tag that i can use in my code to see the diffrent streams or i have to make a new swf file to see the streams.
    Thanks
    Ravi Mishra

    Hi Kanwal,
    Thanks for your quick reply,
    I've already tried this but it didn't work. The problem is that I don't manage the proxy servers so I rely on their skills to see the logs.
    The Proxies are Squid. Do you know if they need to do something else on the servers to see that field of the HTTP header?
    But I'll try again tomorrow and let you know how it goes.
    Thank you again.

  • The Flash Player is not running but it is there and it is enabled and Active X is not checked. The Player version is 16.0.0.305.  I have the latest ie11 and the latest W8.1. I have used the Adobe tool to delete the Flash and subsequently I have updated or

    The Flash Player is not running but it is there and it is enabled and Active X is not checked. The Player version is 16.0.0.305.  I have the latest ie11 and the latest W8.1. I have used the Adobe tool to delete the Flash and subsequently I have updated or reloaded Flash using your updater.  I have gone into IE options and insured that the settings are supportive of Flash.  The Adobe mini Flash test program on your site says it not enabled or Active X is enabled - not true - all is set as it should be.  I have gone through your forums but to no avail.  I've looked in MS forums but nothing that made any difference.  What's going on and what can I do about it?

    Try using Firefox. Flash usually works on Firefox when it won't on Safari. I noticed that the Safari does not show the same version as Firefox does. Iwonder if that could be the problem. Safari on the left shows 10.1, Firefox show 10.3

  • After installing Adobe Flash Player 11.6 The player will not work and i can not find it installed

    After downloading and installing Adobe Flash Player 11.6 on my HP Laptop w/ Windows 7, The player will not work. Every time i click on a video it tells me that i need to install Adobe Flash Player. I have followed all the trouble shooting steps on the Adobe site, I have uninstalled it and reinstalled it again and still it does the same thing...In Adobe trouble shooting steps where it checks to see if there is another Adobe Flash Player installed on my computer, it can not find where there are any installed....so what do i do???

    What is your browser?  If IE:
    http://forums.adobe.com/thread/885448
    http://forums.adobe.com/thread/867968

  • How to use the BD menu built into the player in Encore CS4

    I cant get Encore to create a production that responds to the player Top Menu button (Panasonic Direct Navigator table). Cyberlink, which was bundled with the burner, does this by default. Place a number of videos into the production, dont create a menu, and OK!: Press the Top Menu button and the player's built in table pops up with a list of all titles.
    In Encore, press the Top Menu button, and you get 'operation not allowed'. It appears that Encore requires a Title button action?, but opening the player table is not an option. There is no Title button on the remote; there is Top Menu and Popup Menu.
    There's got to be a simple solution. Player menu tables have been around since DVDs.
    thanks

    I'm not aware of any method to access a menu system that is only built into hardware.  My own Sony DVD does not have such a menu, and if there is none on the DVD, I get none during playback no matter which buttons I press.
    The standard method is to add your own menu if you want a menu.

  • TS4057 I did this and now my videos are not working. They show the pictures aren't there on some and on others it shows they are there, but doesn't show them in the player. When I try to Share anything it just says Waiting for Processing for hours. What d

    I did this and now my videos are not working. They show the pictures aren't there on some and on others it shows they are there, but doesn't show them in the player. When I try to Share anything it just says Waiting for Processing for hours. What do I do?
    I also got Motion and can't figure out how to use it with Final Cut Pro X. Any help woud be great. Thanks

    I have no idea what may have caused your MacBook to stop working, but from your description it kind of sounds like it may have started before you ran Software Update and installed the new Apps. Just the general slow feeling and bugginess is what tips me off. You said that you weren't sure if you had closed all open windows, that doesn't matter if the computer restarts itself. It automatically closes all other open applications when restarting.
    As to your data being retrievable, if when you take it in they do a fresh install of the OS, then no, it will not be unless you want to pay several thousand dollars to a software retrieval company.
    I am glad to hear that you have taken into the Apple Store to get it fixed, and that you have all of your purchased music backed up to your iPod. You should be able to just transfer it all back to iTunes once you get your computer back should it be necessary.
    As a side note, the proper place for this topic would probably in the MacBook forums, not iTunes since there is no evidence that iTunes started the issue.

  • When Pages will support portrait and landscape page orientation in the same document?

    When Pages will finnaly support portrait and landscape page orientation in the same document?

    Only Apple would know, and it isn't telling.
    Peter

  • How do I create a DVD with no theme, i.e., it plays what was recorded when inserted in the player?

    How do I create a DVD with no theme, i.e., it plays what was recorded when inserted in the player?  Nothing extra, just the recorded content.

    Hi
    No Menu on DVD
    from. Mishmunken
    How to create a DVD in iDVD6 without menu (there are several options)
    1. Easy. Drop your iMovie in the auto-play box in iDVD's Map View, then set your auto-play item (your movie) to loop continuously.
    Disadvantage. The DVD plays until you hit stop on the remote
    2. Still easy. If you don't want your (auto-play) movie to loop, you can create a black theme by replacing the background of a static theme with a black background and no content in the drop-zone (text needs to be black as well).
    Disadvantage. The menu is still there and will play after the movie. You don't see it, but your disc keeps spinning in the player.
    3. Still quite easy but takes more time. Export the iMovie to DV tape, and then re-import using One-Step DVD.
    Disadvantage. One-Step DVD creation has been known to be not 100% reliable.
    4. (My preferred method) Easy enough but needs 3rd party software. Toast lets you burn your iMovie to DVD without menu - just drag the iMovie project to the Toast Window and click burn.
    Disadvantage. you'll need to spend some extra $$ for the software. In Toast, you just drop the iMovie project on the Window and click Burn.
    5. The "hard way". Post-production with myDVDedit (free-ware)
    Tools necessary. myDVDedit ( www.mydvdedit.com )
    • create a disc image of your iDVD project, then double-click to mount it.
    • Extract the VIDEO_TS and AUDIO_TS folders to a location of your choice. select the VIDEO_TS folder and hit Cmd + I to open the Inspector window
    • Set permissions to "read & write" and include all enclosed items; Ignore the warning.
    • Open the VIDEO_TS folder with myDVDedit. You'll find all items enclosed in your DVD in the left hand panel.
    • Select the menu (usually named VTS Menu) and delete it
    • Choose from the menu File > Test with DVD Player to see if your DVD behaves as planned. If it works save and close myDVDedit.
    • Before burning the folders to Video DVD, set permissions back to "read only", then create a disc image burnable with Disc Utility from a VIDEO_TS folder using Laine D. Lee's DVD Imager.
    //lonestar.utsa.edu/llee/applescript/dvdimager.html
    hope this helps!
    From LynnLU USA
    www.mediasoftmac.com/dvd-creator-articles/convert-mov-video-to-dvd-on-mac.html#1 29
    Yours Bengt W

  • File orientation on the designjet 800ps, using mac os x and photoshop

    Hi everyone
    We're having a problem with the orientation of the printout we're getting from a designjet 800PS...... The printer is working fine (except for some slight banding), but we are trying to work out the orientation first.
    Essentially when we are printing A1 sheets from the roll of paper it is printing the long side of the poster along the continuous side of the paper. This means that we then have to chop half of the width of paper off, which is a complete waste. What we want to be able to do is rotate the image being printed by 90 degrees so we can print the long side of the poster across the width of the roll, thus saving us paper and making our rolls last longer.
    We are using mac os x leopard (which has the HP drivers for this printer still installed), and printing from photoshop. I assume there should be an option somewhere in the system printer settings when we print, but i cannot for the life of me find them.
    Cheers in advance.
    This question was solved.
    View Solution.

    Need more info!!
    Are you selecting landscape or portrait orientation in page set up and the paper/quality tab of the printer driver when you select print?  Both those settings much match.  Are you using the autorotate feature?  Have you read through your user guide?  Found here:
    http://h20000.www2.hp.com/bizsupport/TechSupport/DocumentIndex.jsp?lang=en&cc=us&contentType=Support...
    Also, is this the 24 or 42 inch designjet?  What size paper?  Roll or Sheet? 
    Just so you know there are some quirks to getting portrait docs to print landscape - 2 fixes if you are doing everything correctly and it's still spinning your doc around:
    1 - if you are printing to a roll that is smaller than the max size, you can lie to the printer and tell it you have a larger size roll installed.
    2 - reduce the overall size of the original document by 1/2 inch.
    There is an issue where when we use autorotate and then chose to print a portrait doc landscape, the spooling software actually makes the document 1 pixel too wide so the printer automatically turns the document back around.  However let's make sure you are setting things up correctly first.
    insert signature here

  • Is it possible to change the orientation with the Ken Burns effect?

    Friends,
    I would like to change the orientation of the Ken Burns effect for a particular photo that I've insterted into a movie.  In other words, the KBE crops the image in landscape mode -- I'd like to crop it in portrait mode (which is how the photo was taken).  How do I do this?
    Thanks!
    Steve

    Tom,
    You broke my heart, but I figured out a way around it using cropping and keyframes.
    Thanks!
    Steve

Maybe you are looking for

  • I Really Need Help With My IPod!!!

    Ok. Whenever I push a button on my ipod the apple pops up and then an ipod with a sad face pops up. I have reset it. That has done nothing. Whenever I put it into disk mode i'll connect it to my computer then the computer will read it but after a few

  • Can I make my HP laserjet m1522nf mfp printing wirelessly?

    I have this non-wireless hp laserjet m1522nf mfp printer at home. I have two laptops and am using FiOS wireless router for wireless internet access. I also have a Rosewill wireless router. It is not a printer server, just a regular wireless router. N

  • Pinning the sql query in cache

    Hi All, I want to pin the sql query is cache because the physical reads are very high. Can anyone tell me steps to pin the sql query in the cache. Current version 10.2.1.0 OS : Windows. Reads CPU Elapsed Physical Reads Executions per Exec %Total Time

  • [Solved] System fully up-to-date, apps look for old libs

    Even though the system is fully updated from a fresh mirror, apps look for older libs: e.g. irssi and wget look for libssl.so.0.9.8, building wget with makepkg wants libgmp.so.3 (the latest is 10). ldd run on said apps returns the newer lib versions,

  • Safari 6.0 command- doesn't work

    Command+ works fine but command- doesn't work. I'm running 10.7.5