Sprite gets stuck in mid-movement

I am having some trouble with a sprite not knowing when the
mouse is outside it's bounding edges, and when it's inside.
I have a script set up, so that when you roll over the
particular sprite, it moves to the left 40 pixels, 10 pixels at a
time so it has a smooth effect.
when you roll off of the sprite, the sprite should move back
to the right 40 pixels, but once again it moves 10 pixels at a
time. Somewhere in my script, the sprite gets stuck. if you roll
over the sprite too quickly the sprite stops after moving 10
pixels, and then won't move again. At all. It's stuck. I know
someone out there knows why this isn't working. Any help is much
appreciated. Thanks so much.
-So here's my script.
property pRight
property pLeft
on beginSprite me
pRight=0 --set it to not shrink when it starts up
pLeft=0
end
on mouseEnter me
pLeft = 1
end
on mouseLeave me
pRight=1 --start shrinking now
end
on enterFrame me
if pRight=1 then
if sprite("Button 1").locH<470 then
sprite("Button 1").locH=sprite("Button 1").locH+10
else
pRight=0 --now it will stop shrinking
end if
end if
if pLeft = 1 then
if sprite("Button 1").locH>440 then
sprite("Button 1").locH=sprite("Button 1").locH-10
else pLeft = 0
end if
end if
end

Yes, or instead of using two parameters just use one, maybe
called
pDirection and set it to 1 or -1 then in your enterFrame,
don't use two
different if statements. It will work but it's not efficient.
if pDirection = 1 then
else
if pDirection = -1 then
end if
end if
This shows anyone reading your code that the value of
pDirection can only be
one or the other, even though in your code it doesn't matter
because the
value of your parameter cannot change inside a handler unless
you set it
yourself.
Craig Wollman
Lingo Specialist
Word of Mouth Productions
212-928-9581
www.wordofmouthpros.com
"BSpero" <[email protected]> wrote in
message
news:epqjgr$f7o$[email protected]..
> There is probably a better way to write this up, but
using your code, the
> problem is that it is possible to end up with both of
the properties set
> to
> "1". Then, on the enterFrame, they just cancel each
other out. So, on
> mouseEnter, set the pRight to 0 at the same time you set
the pLeft to 1.
> Do the
> same for the mouseLeave...
>
> on mouseEnter me
> pLeft = 1
> pRight = 0 -- make sure that you are not trying to move
it both ways
> end
>
>
> on mouseLeave me
> pRight=1 --start shrinking now
> pLeft = 0 -- make sure that you are not trying to move
it both ways
> end
>
>
>

Similar Messages

  • Imovie stuck on creating movie

    I created a slideshow and when i go to share, file and save it to my documents it doesnt save, it gets stuck on creating movie in the theater, there is no progress in the bar. Help! what am I doing wrong?

    I have this same issue, I just get the wheel constantly. I have tried moving all the files out of the Movie folder, I have tried re installing iMovie. Its very frustrating, I just cant use it? Anyone with any ideas, please help!!! tried apple support and i just get told to stay by my phone and they will call shortly, still waiting!!!

  • Running a mid 2009 iMac on 10.7.5, 3 gb memory, 320 gb hd.    Suddenly the computer stoped reading DVDs and the only time I can read a CD is if I restart.  Quite often when I insert a CD it gets stuck and I cannot get it out until I restart and it shows u

    Running a mid 2009 iMac on 10.7.5, 3 gb memory, 320 gb hd. 
    Suddenly the computer stoped reading DVDs and the only time I can read a CD is if I restart.  Quite often when I insert a CD it gets stuck and I cannot get it out until I restart and it shows up on the desktop where I can then eject it.
    I have checked and double checked the finder prefs and all looks normal showing a check mark on CDs,DVDs etc. (the ones I want to show up on the desktop)
    I have reset the PEAM, repaired permissions with both the disk utility on the computer and the disk utility when I start up in the Recovery Disk.  I did notice that sometimes the permission repeat the same correction several times before it moves on, and sometimes it doesn’t. I have Windows installed on a partition but I keep it unmounted until it is needed for my wife’s work.  The dock seems to be just fine and all the apps seems to run just fine.  When I insert a photo CD iPhoto does not open but when I insert a music CD iTunes does open. 
    Also, most every time I open iPhoto it takes a long time(sometimes as long as 2 minutes) for it to load.
    Sometimes my Mail (Mail 5.3) does not post new mail but most of the time it does. 
    Once and a while it seems like the computer slows way down but then it seems ok ten minutes later.
    All  of these ‘things’ seemed to have happen suddenly and I have not downloaded anything from the internet in some time.
    Of course the warranty and extended warranty are both no longer in effect having had this computer for more than three years.
    I am running Java and Adobe Player because some of the sites I go to a lot require both.

    I believe that insufficient RAM may be the source of some of your problems. If you have a RAM of somewhere 4 to 8GB, you will experience smoother computing. 3GB doesn't seem right, so you might want to learn more by going to this site:
    http://www.crucial.com/store/drammemory.aspx
    I don't know what know what's happening with your optical drive, but it seems you use your drive quite a bit. In that case, look into a lens cleaner for your machine. It's inexpensive, works quite well.
    I hope you'll post here with your results!

  • When I try to update to iOS5, iTunes gets stuck on "Backing Up" its been there for hours and it barely moves

    When I try to update to iOS5, iTunes gets stuck on "Backing Up" its been there for hours and it barely moves. It finished backing up one then it went to a "Extracting Software" on the iTunes status bar up top and then it gave me an error saying something along the lines of "There was an error with the server" and back to square 1. Ive been trying since the morning and same problem. Always stuck on the backup, help?

    You may have lost your connection to the apple server or connection with your itunes library.
    1) You will need to shutdown Itunes and disconnect your iphone from the USB cable.
    2) Reconnect your Iphone to the usb cable, wait for the device to be recognised and or drivers to be installed.
    3) once all ok, your itunes should automatically open up/connect (if you have this setting set on), otherwise double click your itunes icon on your desktop.
    4) once all sychronised and connected. go to Summary tab and UPDATE your iphone again.
    Hope this works for you, as this happend to me and tried the above steps and wala!!! all good.
    If the above still fails, restart your pc/apple and turn off/on your modem and then try again.
    this normally happens if your connection from your device to the itunes hangs or looses its connection, or have a bad connection to the internet / apple server.
    in windows the RPC Locator is normally the cause of this, in apple i have no idea (as im not an apply user).
    Give it a shot!
    if this helps you and works ...why not rep/like my response up!

  • Every time I try and open up my itunes it will get stuck on lode. I am not able to click on anything or close down the page. I have to restart my computer. I have a new ipod and can't even downlode my music or watch my movies! what is going on?

    Every time I try and open up my itunes it will get stuck on lode. I am not able to click on anything or close down the page. I have to restart my computer. I have a new ipod and can't even get my music on it or watch my movies! what is going on?
    A box will pop up and tell me there is a new version of itunes to download, but i'm un able to click on that either

    Hi Coreenfrombc,
    If you are having issues with iTunes after an attempted update, you may find the following article helpful:
    iTunes 11.1.4 for Windows: Unable to install or open
    http://support.apple.com/kb/TS5376
    Regards,
    - Brenden

  • The select function in Pages and other apps gets stuck and the cursor will not move. What do I do?

    The select function in Pages and other apps gets stuck when I touch a word and the cursor will not move. What is the answer for this problem?

    Try reset iPad
    Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears
    Note: Data will not be affected.

  • Constantly getting Stuck Midi Notes w/ LP & Digi 002R

    Running LP 7.1 & Tiger on a G5 DualCore 2.0
    I'm constantly getting stuck notes (hanging) with using a Digi002R's midi ports going to a Roland XV5080, the other is going to a Motif ES. It's happening more than just once in a while. Any ideas on what is causing it?

    Crazyhorsestudios wrote:
    I don't have 8.02 installed just what came in the box 8.0. Yes I am using the DAE Engine as it activates because I am playing audio through the Digi002R.
    That may be it. But I have to believe I am not the only one using MTPAVs as they are extremely popular. They all can't be using Unitors?
    Completely legal I have the box any everything. I wouldn't even know would you even get a cracked version. Too problems taking me away from music to add bootleg software to the mix.
    You should be able to upgrade to 8.02 via Software Update or in Apple's download section. The initial release of Logic 8 was terribly buggy.
    Choose an external MIDI track. In the "Inspector" on the left hand side of the screen you will see the Port: designation. Do all of the MTP's show up there, whatever you do don't set it to ALL. You should be able to choose the correct MTP and underneath that, the channel.
    You might try disabling DAE and see if the problem persists.
    Here's another idea. Are you using MIDI Clock Sync on any of your external synths.
    Go to Settings/Synchronization/MIDI Tab
    If you're not using MIDI clock sync.. set all "Destinations" to off and then disable every checkbox, same for MTC and MMC.
    If you are using MIDI clock sync activate the Send MIDI Clock checkbox and select only a single MTPav as the destination.
    Remember, Settings are on a per song basis, Preferences are Global.
    Thanks for answering the bootleg question, lately there's been quite a bit of that around here.. these are user forums and it makes it difficult to try and help people when they're using old dodgy version of plugins and programs they shouldn't have in the first place.
    p.s. you aren't using rewire for anything, are you?

  • I have an hd movie on both my ipad and iPhone 5, using airplay with my iPhone 5 plays perfectly but gets stuck with my ipad 2, almost like its buffering? I just want it to play smoothly like with my iPhone. Any suggestion?

    I have an hd movie on both my ipad and iPhone 5, using airplay on my apple tv with my iPhone 5 plays perfectly but gets stuck with my ipad 2, almost like its buffering? I just want it to play smoothly like with my iPhone. Any suggestion?

    About 6 months ago I discovered iTunes was set by default to 720p. These MUST BE CHANGED TO 1080P!!!!!!!!.......So I installed FULL 1080P file on my laptop on iTunes...  When I download movies on iPhone 5s/iPad mini the file is 720p So within about 60 seconds of starting download of 1080p files into my laptop of iTunes purchases. It was at that moment that I realized it was that file my laptop has on file to sync to my Apple device...Ten minutes later when the first 1080P HD file was downloaded  I must say... The resolution is amazing... I now use this same process to install movie files from iTunes.. In FULL 1080P.. Not 720P... Works on my iPad mini also... Avatar is 5.4 GB if installed over Wi-Fi... However sync with laptop and file is 6.5 GB in size... Called Apple told them... No reply yet.... You must delete 720P files from your laptop... Look for file size in any movie purchase and you will see DOWNLOAD IN 1080P.. This will open preferences in iTunes for you to the correct tab so you can change setting to 1080p from default of 720p... DELETE any downloaded movies already downloaded into laptop... You can check file quality by right click on any movie folder and the look at movie info... Will say 720p HD... Delete to recycle bin and iCloud will appear on each movie... Now download 1080P HD file... When completed. Right click any file to verify it is 1080P HD... The sync with device...... And get ready to be upset with Apple for holding back your device for the last 2 years 3 months and 16 days......And be ready to catch your jaw from hitting the floor when you see your screen in full 1080P HD.... Apple Engineer's were asleep.....
    You will notice better pic quality... Apple by default is still sending the 720P file to the new iPhone 6 plus over wifi and sync.. howve this process above will give you full HD file for your Apple device...

  • When i open it gets stuck at "initializing installer" and the green bar doesnt move. How do i fix this so it installs?

    Adobe cloud setup downloaded off the internet just fine but when i open it gets stuck at "initializing installer" and the green bar doesnt move. How do i fix this so it installs?

    Multiredwolf123 have you utilized the steps listed in Error "Failed to Install" Creative Cloud Desktop application - http://helpx.adobe.com/creative-cloud/kb/failed-install-creative-cloud-desktop.html to resolve the current error?

  • Preloader gets stuck when I test movie

    The preloader was the first thing I coded before I started designing the next frames, and it initially worked when it was the only frame, but after adding stuff to the next frames, the preloader keeps getting stuck at 30% everytime i test the movie, i'm clueless.
    here's the code if it helps
    stop();
    enter_mc.visible=false;
    enter_mc.addEventListener(MouseEvent.CLICK, goHome);
    function goHome(e:MouseEvent):void {
    gotoAndStop("2");
    this.addEventListener(Event.ENTER_FRAME, preload);
    var total:Number = this.stage.loaderInfo.bytesTotal;
    var loaded:Number = this.stage.loaderInfo.bytesLoaded;
    function preload(e:Event):void {
    preAnim_mc.gotoAndStop(Math.floor((loaded/total)*100))
    prog_text.text = Math.floor((loaded/total)*100)+ "% loaded";
    if (total == loaded) {
    preAnim_mc.visible = false;
    prog_text.visible = false;
    enter_mc.visible = true;
    it never gets to the if statement

    Try moving that if section of code inside the preload function.  It probably gets to the if statement, but just once when the file first starts, but since it won't pass the if(test) at that point it appears to not execute... as standalone code there is nothing to make it continually execute.

  • HT1657 I have rented a movie via apple tv and it gets stuck at 4 minutes left to download. I have not been able to watch and I can't get it to completely download.

    I have rented a movie via apple tv and it gets stuck at 4 minutes left to download. I have not been able to watch and I can't get it to completely download.

    You've tried restarting the film ? If it still skips then try the 'report a problem' link from your purchase history : log into your account on your computer's iTunes via Store > View My Account and you should then see a Purchase History section with a 'see all' link to the right of it ; click on that and you should see a list of your purchases ; find that film and use the 'Report a Problem' link and fill in details about the problem (iTunes support should reply within, I think, 24 to 48 hours).
    Some people have had a problem with the 'report a problem' link (it's been taking people to this site on a browser instead of showing a form in iTunes) - if it does that to you then try contacting iTunes support via this page : http://www.apple.com/support/itunes/contact/- click on Contact iTunes Store Support on the right-hand side of the page.

  • Gets stuck on checking midi drivers at launch

    After upgrading to Lion 10.7.5, Logic Pro 9 Version 9.1.7 gets stuck on lauch checking for midi drivers. I also recieve an error pop up that says:" Error initializing Core Midi. faulty driver? Please restart computer."  I did that, but still getting stuck. I also don't have any midi drivers in my preference library>audio>midi drivers. Anybody have a solution? Should I download new midi drivers? Reinstall Logic 9 again?

    Probably because you have ProTools installed. The Digi/Avid core MIDI driver is not 100% Lion compatible and Logic can't initialize it.
    It needs to be be moved out of the MIDI Drivers folder.
    Usually found here
    ~Library/Audio/MIDI Drivers
    You may need to flush the caches and reboot after moving it.

  • I purchased a movie through iTunes and the movie gets stuck on the opening screen and will not play.  Has anybody had this happen?  And if so is there any solution?

    I purchased a movie through iTunes and the movie gets stuck on the opening screen and will not play.  Has anybody had this happen?  And if so is there any solution?

    Hey Christian,
    I'd follow the troubleshooting steps below, from this article:
    Apple computers: Troubleshooting issues with video on internal or external displays
    http://support.apple.com/kb/ht1573
    Reset the system
    You can reset the Mac's parameter RAM and SMC.
    Reset the resolution
    Start by resetting the Mac's parameter RAM. If the display does not come up, was previously set to an unsupported resolution, and still results in no video:
    Start up in Safe Mode.
    From the Apple () menu, choose System Preferences.
    Choose Displays from the View menu to open the preferences pane.
    Select any resolution and refresh rate that your display supports.
    Restart your computer.
    See if that resolves the issue and gets your video playing again.
    All the best,
    David

  • Flash installer gets stuck on 35% and won't move (Mac Yosemite)

    Hi all, I posted my problem a week ago on the wrong board I think! and didn't get nay answers so hopefully will have more luck here :) I have always had Flash on my Mac (Yosemite) always updated no problem. It said today I needed to update it so clicked on the install button and did the usual but it keeps getting stuck around the 30/35% stage. I have followed steps on Adobes help pages, tried installing Flash and then re-installing but it keeps doing the same thing! Any ideas on what it could be thats stopping  it ??

    I seem to have got mine working, I went via the Apple website and found this link, DMG installer ?  Couldn't tell you how but it worked Adobe Flash Player Distribution | Adobe

  • Flash movie gets stuck in the middle

    Hey,
    I have simple sliding pages mechanism in my flash file, all done with AS3 code. Now the pages, which are movieclips, are slid off the screen on a button press. Sometimes, everything goes smoothly, but on some people's computers the sliding pages get stuck in the middle, and then the next slide starts from the wrong position. This throws everything off the loop...I cannot understand why this is happening..as it only happens sometimes...I have rechecked the code millions of times...why is this happening??? Is it the code??
    The file can be checked out at http://cleatbeat.com/halftime/issue5/index.html.
    Any suggestions will be greatly welcome..am I doing something wrong in the code...??
    Cheers,
    Aditi

    Can't say anything without seeing the codes.
    I guess you have some errors at calculating the sliding effect.
    When clicked too fast sliding errors occur.
    You have to disable the click event till the the page stops at the right position  (removeListener for the button, then addListener....)

Maybe you are looking for

  • Settlement Rule

    Can anyone please advise on the following. We have a project (WBS) created that has a settlement rule just for AUC in 07/08, was settled in both 07/08 and 08/09 with automatic settlement. We know want to add a rule for full settlement to transfer it

  • Finite pulse train generation​... how to count number of pulses?

    hi guys, this has probably been solved a hundred times but i just couldnt find it!! i have a pulse train generation happening on my ni usb-6211... using FREQ OUT, using a divisor on this, and routing it to PFI4. id like to update my VI so i can speci

  • How to rip with a pc station

    I just installed my mac osx server 10.6.8 to gain speed via a network. I have 3 IMac and a PC. I need the pc to RIP my job for printing. Before my data were on a DROBO FS. I cannot rip via the server but still can on the drobo. Can somebody help me.

  • Encore authored DVD displaying wrong audio track language info

    Authored a number of DVDs using Encore CS6. Some play fine and some show incorrect audio track language info when played back on a DVD player even though they are programmed correctly and the same as the ones playing correctly. Has anyone else encoun

  • T61 - Bluetooth audio problem

    My computer: Lenovo T61. System: Windows 7 64b. Bluetooth device manufacturer: Broadcom. I have severe problem with my bluetooth internal device. I wanted to connect my computer with external audio device (bluetooth speakers) and I found that my comp