Scroll movieclip at 2x the speed as it currently is

Hi!
I have 2 buttons that are currently scrolling a movie clip with this function on(rollover):
function moveMC(end, dir) {
mc.onEnterFrame = function() {
  if (Math.abs(mc._x-end)>1) {
   mc._x += dir*step;
  } else {
   mc._x = end;
How is it possible to get get it to scroll at 2x that speed on(press)  ?
Thanks for the assistance

Ok, I updated the code to just have the function that you gave me.  All of the on(press) functions have 3 parameters but now when you hold down the on(press), the movie clip doesn't stop at the end parameter like it used to?
Do you see what I mean by looking at the code below?
function moveMC(end, dir, step) {
     mc.onEnterFrame = function() {
          if (Math.abs(mc._x-end)>1) {
               mc._x += dir*step;
          } else {
               mc._x = end;
/*function moveMCTwo(end, dir, step) {
     mc.onEnterFrame = function() {
          if (Math.abs(mc._x-end)>1) {
               mc._x += dir*step;
          } else {
               mc._x = end;
left.onRollOver = function() {
     moveMC(-2410,-1, 5);
     /*if(_root.mc._x > -672){
     moveMC(-660,-1);
     }else if(_root.mc._x == -660){
     trace("done")
left.onRollOut = function() {
     delete mc.onEnterFrame;
left.onPress = function() {
     moveMC(-2410,-1,20);
left.onRelease = function() {
     moveMC(-2410,-1, 5);
right.onRollOver = function() {
     moveMC(488.15,1, 5);
right.onRollOut = function() {
     delete mc.onEnterFrame;
right.onPress = function() {
     moveMC(488.15,1,20);
right.onRelease = function() {
     moveMC(488.15,1, 5);

Similar Messages

  • Why can't I use 2 scrolling movieclips in the same movie?

    Hi all,
    I've created a couple of sites now that both use scrolling
    movieclips...
    If there is one scrolling mc, it works fine but as soon as I
    add another (using the same code and instance names - just a
    different mc) the up buttons fail to work properly. I've tried
    changing the instance names but it makes no difference.
    Does anyone know why this happens? Is it a bug in Flash 8? Is
    there a way round this?
    Thank you very much and I look forward to hearing from you.
    Take care,
    Mark

    hi there,
    many thanks for the reply.
    it might be easier to see what i'm doing rather than actually
    describing it...
    i've uploaded my fla
    here. the
    unlocked layers on the main timeline are the ones of interest.
    have you had this problem before? if you test the movie and
    select a section with the scrollbars (ie. the gallery) it just
    jumps to a random place for no apparent reason!
    thank you very much once again.
    all the best,
    mark

  • Changing the speed of MovieClip

    Hi, I am new to Flash and Actionscript and am currently working on some code pulled from another post to try and learn from what others are doing or have done. I have created a star movieclip and am attempting to move it randomly accross the stage in a relatively slow speed. When I run it, it moves randomly but way too fast. I have spent the last 6 hours playing with the code, researching help files and also looking up other discussions but nothing seems to be helping. Here is what I have so far. My apologies if the code looks like a hack. This is being done in CS4 if that matters at all. If anyone could shed some more light on how to handle controlling the speed or rate of random movement with some insight, I would be greatful.
    Thanks,
    Ather
    //-- import the flash classes first for tweening
    import fl.transitions.Tween;
    import fl.transitions.easing.*;
    //-- the ENTER FRAME event is needed to animate and move objects via script and moves it through frames
    addEventListener(Event.ENTER_FRAME, starMove);
    //-- this function keeps moving the star across the screen
    function starMove(e:Event):void {
        var Speed:Number = 5;
        var Sx:Number;  // x speed
        var Sy:Number;  // y speed
        var dx:int = Math.random();
        var dy:int = Math.random();
        star_mc.x = (Math.random() * stage.stageWidth);
        star_mc.y = (Math.random() * stage.stageHeight);
        Sx = Math.random() * Speed;
        Sy = Math.random() * Speed;
        star_mc.x += Sx * dx;
        star_mc.y += Sy * dy;

    The problem is that you recalculate all the parameters inside enterFrame event listener and I don't see any algorithm that makes sense in terms of these calculation. Here is an example how it can be done in principal (replace star Sprite with you object):
    // replace it with your star
    var star:Sprite;
    // speed along x
    var sx:Number;
    // speed along y
    var sy:Number;
    // direction along x
    var dx:Number;
    // direction along y
    var dy:Number;
    // maximum speed
    var maxSpeed:Number = 5;
    init();
    function init():void
         star = new Sprite();
         var g:Graphics = star.graphics;
         g.beginFill(0xff0000);
         g.drawRect(0, 0, 20, 20);
         g.endFill();
         addChild(star);
         // position it so it is always visible at start
         star.x = stage.stageWidth * .25 + Math.random() * stage.stageWidth * .5;
         star.y = stage.stageHeight * .25 + Math.random() * stage.stageHeight * .5;
         // initital parameters are random
         sx = Math.random() * maxSpeed;
         sy = Math.random() * maxSpeed;
         dx = Math.random() > .5 ? 1 : -1;
         dy = Math.random() > .5 ? 1 : -1;
         // start animation
         addEventListener(Event.ENTER_FRAME, moveStar);
    function moveStar(e:Event):void
         star.x += sx * dx;
         star.y += sy * dx;

  • How to control the speed of nested movie with mouse

    I have a movie nested inside another movie with pictures that
    scroll horizontally across the screen. I would like the user to be
    able to control the speed and direction of the pictures by moving
    their mouse. Can anyone give me some insight on where to look to
    find out how to do this?
    If this can't be done then perhaps add controls on the screen
    to stop / play / speed up / slow down the horizontal scrolling
    pictures

    it can be done. search for a scrolling movieclip tutorial
    using google or at flashkit.com

  • In iMovie '11 how do I slow down my credits at the end of my movie.  I typed them in, but the speed is too fast.

    I have iMovie '11, and I can't find how to slow down the "credits" I've typed in at the end of my movie.  I guess
    it would be the scrolling speed.

    Credits scroll at the speed that is necessary for the scrolling to complete by the end of the clip.  So, to slow them down, simply prolong the duration of the scrolling credits title clip by selecting and draggging out the yellow boundary.
    Geoff.

  • Follow an object (mouse click) without decreasing the speed

    hello,
    i want to make a movie clip follow the mouse while we are pressing the left Button (NOT "be" the mouse ), i end it up with this code but am having a problem,
    -the speed of the movie clip decrase by his own, i know that this is happening because of the last two lines, i will be glad if anyone could help me to solve this problem, thanx
    onClipEvent (enterFrame) {
              onMouseUp = function ()
                        apui = false;
              onMouseDown = function ()
                        apui = true;
                        rotateSpeed = 3;
              if (apui == true)
                        goX = _root._xmouse;
                        goY = _root._ymouse;
              else if (apui == false)
                        goX = this._x;
                        goY = this._y;
              this._x -= (this._x - this.goX)/20 ;
              this._y -= (this._y - this.goY)/20 ;

    thank you, this is solved the speed issue, now i had one last problem, the rotation,
    1st let me know if i had to close this discussion and start another one cause i found what i was looking for .
    but maybe i can ask about it here,
    so here is the rotation issue,
    first here is my rotation code
    function rotateTowards(clip, targetX, targetY)
              var clipPoint = {x:clip._x, y:clip._y};
              clip._parent.localToGlobal(clipPoint);
              var deltaX = targetX - clipPoint.x;
              var deltaY = targetY - clipPoint.y;
              var rotationRadian = Math.atan2(deltaY, deltaX);
              var rotationAngle = radiansToDegrees(rotationRadian);
              clip._rotation -= (clip._rotation-rotationAngle)/8;
    function radiansToDegrees(radians)
              return (radians / Math.PI) * 180;
    and i have this code on my car movieClip
    onClipEvent (load) {
              rotateSpeed = 3;
    onClipEvent (enterFrame) {
              onMouseUp = function ()
                        apui = false;
              onMouseDown = function ()
                        apui = true;
                        rotateSpeed = 3;
              if (apui == true)
                        goX = _root._xmouse;
                        goY = _root._ymouse;
                        rotX = _root._xmouse;
                        rotY = _root._ymouse;
                        _root.rotateTowards(this,rotX,rotY);
              else if (apui == false)
                        goX = this._x;
                        goY = this._y;
              _root.destination_mc._x = goX;
              _root.destination_mc._y = goY;
              this._x -= (this._x - this.goX) / 15;
              this._y -= (this._y - this.goY) / 15;
    my problem is to make the rotation more "realistic" for example if we choose to go to the opposit direction i need the car to rollback then make a 1/2 turn then go tward the point
    thank you

  • How can you increase the speed with a slider

    I have been trying to work at this for about a week and a
    half. I browsed several communities but it seems that noone has an
    answer so I am not even sure if this is possible I am not a flash
    expert but what I am trying to do is as follows;
    I have a movie with several movie clips. I have an animation
    of a female walking, I also have a slider that when I move it to
    the right bags are added on to her. but what I am also trying to
    accomplish is to have her walk faster as the slider moves to the
    right.
    I tried several scripts but they seem not to work as I wan
    them to plus they start to cancel out the bag function.
    How could I make this happen if it is even possible. I want
    to use the slider to increase the speed of the lady walking. Slider
    and Lady are movie clips.
    thanks in advance

    At present I'm not aware of any way to achieve this exact effect in Muse (where the first screen of a web page is resized to fill the browser window and the rest of the page, as you scroll down, appears to be fixed height layout).

  • The status bar is pushed up at about 3/4 of the screen, so I can view onlu firefox at about 1/4, good thing there is a scroll bar, but below the status bar is white display? can u please help me, I want to drag down the status bar so I can have a full vi

    The status bar is pushed up at about 3/4 of the screen, so I can view only Firefox at about 1/4, good thing there is a scroll bar, but below the status bar is white display? can u please help me, I want to drag down the status bar so I can have a full view
    == This happened ==
    Every time Firefox opened

    Your code is absolutely unreadable - even if someone was willing to
    help, it's simply impossible. I do give you a few tips, though: If you
    understand your code (i.e. if it really is YOUR code), you should be
    able to realize that your minimum and maximum never get set (thus they
    are both 0) and your exam 3 is set with the wrong value. SEE where
    those should get set and figure out why they're not. Chances are you
    are doing something to them that makes one 'if' fail or you just
    erroneously assign a wrong variable!

  • I have added/embedded four videos on my website, but when I scroll down, the videos scroll in front of the top menu instead of behind as it should. I have tried changing layers, etc., and nothing works. Can you help?

    I have embedded 4 videos on my website. It is a single page, scrolling site. When I scroll down, the videos scroll in front of the top menu bar, instead of behind it. I have tried changing layers, etc., and nothing works. Please help.
    Thanks.
    Paul W. Norman

    Hi,
    Kindly create a new layer, via the Layers panel:
    Then, right click on the navigation bar, and choose Move to Layer > Layer 2
    Ensure that Layer 2 is on top of the other layers.
    Hope it helps,
    Sonam

  • Nice to see 13" retina but it has only Intel HD Graphics 4000 and does not have NVIDIA GeForce GT 650M with 1GB of GDDR5 memory card. How it will affect the speed, performance and other things compared to 15" retina where NVIDIA GeForce card is available.

    Nice to see 13" retina but it has only Intel HD Graphics 4000 and does not have NVIDIA GeForce GT 650M with 1GB of GDDR5 memory card. How it will affect the speed, performance and other things compared to 15" retina where NVIDIA GeForce card is available.

    The 15" Retina's will have better performance than any 13" Retina. Not only do the 15" machines have dedicated GPU's, but they also have quad-core processors, whereas the 13" Retina's only have dual-core processors.

  • Whats the best option to increase the speed on my mid 2010 macbook pro?

    What choices are there for me to increase the speed of my computer ?

    More RAM and a SSD. If you're running under 8GB of RAM, I would recommend upgrading to 8GB. You can check out Crucial or OWC for the correct RAM configuration for your model.
    While you're at Crucial, I would also look at the available SSDs that would fit your machine - just use the System Scanner tab, and it will show you the recommended upgrades.
    RAM and SSDs are about the only things you can upgrade to make your computer faster.
    If you're new to SSDs, see my user tip here -> https://discussions.apple.com/docs/DOC-4741.
    Good luck,
    Clinton

  • Which Mac Pro? More cores=slower speeds? And most of us know the speed matters or FPU for music and I don't understand the faster is for the least amount of procs. And while I get the whole rendering thing and why it makes sense.

    Which Mac Pro? More cores=slower speeds? And most of us know the speed matters or FPU for music and I don't understand the faster is for the least amount of procs. And while I get the whole rendering thing and why it makes sense.
    The above is what the bar says. It's been a while and wondered, maybe Apple changed the format for forums. Then got this nice big blank canvas to air my concerns. Went to school for Computer Science, BSEE, even worked at Analog Devices in Newton Massachusetts, where they make something for apple. 
    The bottom line is fast CPU = more FPU = more headroom and still can't figure out why the more cores= the slower it gets unless it's to get us in to a 6 core then come out with faster cores down the road or a newer Mac that uses the GPU. Also. Few. I'm the guy who said a few years ago Mac has an FCP that looks like iMovie on Steroids. Having said that I called the campus one day to ask them something and while I used to work for Apple, I think she thought I still did as she asked me, "HOW ARE THE 32 CORES/1DYE COMING ALONG? Not wanting to embarrass her I said fine, fine and then hung up.  Makes the most sense as I never quite got the 2,6,12 cores when for years everything from memory to CPU's have been, in sets of 2 to the 2nd power.  2,4,8,16,32,64,120,256,512, 1024, 2048,4196,8192, 72,768.  Wow. W-O-W and will be using whatever I get with Apollo Quad. 
    Peace to all and hope someone can point us in THE RIGHT DIRECTION.  THANK YOU

    Thanks for your reply via email/msg. He wrote:
    If you are interested in the actual design data for the Xeon processor, go to the Intel site and the actual CPU part numbers are:
    Xeon 4 core - E5.1620v2
    Xeon 6 core - E5.1650v2
    Xeon 8 core - E5.1680v2
    Xeon 12 core - E5.2697v2
    I read that the CPU is easy to swap out but am sure something goes wrong at a certain point - even if solderedon they make material to absorb the solder, making your work area VERY clean.
    My Question now is this, get an 8 core, then replace with 2 3.7 QUAD CHIPS, what would happen?
    I also noticed that the 8 core Mac Pro is 3.0 when in fact they do have a 3.4 8 core chip, so 2 =16? Or if correct, wouldn't you be able to replace a QUAD CHIP WITH THAT?  I;M SURE THEY ARE UO TO SOMETHING AS 1) WE HAVE SEEN NO AUDIO FPU OR PERHAPS I SHOULD CHECK OUT PC MAKERS WINDOWS machines for Sisoft Sandra "B-E-N-C-H-M-A-R-K-S" -
    SOMETHINGS UP AND AM SURE WE'LL ALL BE PLEASED, AS the mac pro      was announced Last year, barely made the December mark, then pushed to January, then February and now April.
    Would rather wait and have it done correct than released to early only to have it benchmarked in audio and found to be slower in a few areas- - - the logical part of my brain is wondering what else I would have to swap out as I am sure it would run, and fine for a while, then, poof....
    PEACE===AM SURE APPLE WILL BLOW US AWAY - they have to figure out how to increase the power for 150 watts or make the GPU work which in regard to FPU, I thought was NVIDIA?

  • My performance is very slow when I run graphs. How do I increase the speed at which I can do other things while the data is being updated and displayed on the graphs?

    I am doing an an aquisition and displaying the data on graphs. When I run the program it is slow. I think because I have the number of scans to read associated with my scan rate. It takes the number of seconds I want to display on the chart times the scan rate and feeds that into the number of samples to read at a time from the AI read. The problem is that it stalls until the data points are aquired and displayed so I cannot click or change values on the front panel until the updates occur on the graph. What can I do to be able to help this?

    On Fri, 15 Aug 2003 11:55:03 -0500 (CDT), HAL wrote:
    >My performance is very slow when I run graphs. How do I increase the
    >speed at which I can do other things while the data is being updated
    >and displayed on the graphs?
    >
    >I am doing an an aquisition and displaying the data on graphs. When I
    >run the program it is slow. I think because I have the number of
    >scans to read associated with my scan rate. It takes the number of
    >seconds I want to display on the chart times the scan rate and feeds
    >that into the number of samples to read at a time from the AI read.
    >The problem is that it stalls until the data points are aquired and
    >displayed so I cannot click or change values on the front panel until
    >the updates occur on the graph. What can I do to be a
    ble to help
    >this?
    It may also be your graphics card. LabVIEW can max the CPU and you
    screen may not be refreshing very fast.
    --Ray
    "There are very few problems that cannot be solved by
    orders ending with 'or die.' " -Alistair J.R Young

  • My macbook's performance is quite slow and it freezes I haven't shut it down in over a month. I shut it down yesterday for over 12 hours yet upon starting up again the slowness persists. Removed Google chrome application the speed arose slightly any tips?

    I haven't shut it down in over a month. I shut it down yesterday for over 12 hours yet upon starting up again the slowness persists. Removed Google chrome application the speed arose slightly any tips? I contacted a support member but unfortunately my warranty has run out, he suggested that may be a result of putting the mac into sleep constantly, and not shutting down and that there may be files i can clear to remedy the issue. Any suggestions would be greatly appreciated,
    Regards.

    First, back up all data immediately, as your boot drive might be failing.
    There are a few other possible causes of generalized slow performance that you can rule out easily.
    Reset the System Management Controller.
    If you have many image or video files on the Desktop with preview icons, move them to another folder.
    If applicable, uncheck all boxes in the iCloud preference pane.
    Disconnect all non-essential wired peripherals and remove aftermarket expansion cards, if any.
    Check your keychains in Keychain Access for excessively duplicated items.
    Boot into Recovery mode, launch Disk Utility, and run Repair Disk.
    Otherwise, take the steps below when you notice the problem.
    Step 1
    Launch the Activity Monitor application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Activity Monitor in the icon grid.
    Select the CPU tab of the Activity Monitor window.
    Select All Processes from the menu in the toolbar, if not already selected.
    Click the heading of the % CPU column in the process table to sort the entries by CPU usage. You may have to click it twice to get the highest value at the top. What is it, and what is the process? Also post the values for % User, % System, and % Idle at the bottom of the window.
    Select the System Memory tab. What values are shown in the bottom part of the window for Page outs and Swap used?
    Next, select the Disk Activity tab. Post the approximate values shown for Reads in/sec and Writes out/sec (not Reads in and Writes out.)
    Step 2
    If you have more than one user account, you must be logged in as an administrator to carry out this step.
    Launch the Console application in the same way you launched Activity Monitor. Make sure the title of the Console window is All Messages. If it isn't, select All Messages from the SYSTEM LOG QUERIES menu on the left. If you don't see that menu, select
    View ▹ Show Log List
    from the menu bar.
    Select the 50 or so most recent entries in the log. Copy them to the Clipboard (command-C). Paste into a reply to this message (command-V). You're looking for entries at the end of the log, not at the beginning.
    When posting a log extract, be selective. Don't post more than is requested.
    Please do not indiscriminately dump thousands of lines from the log into this discussion.
    Important: Some personal information, such as your name, may appear in the log. Anonymize before posting. That should be easy to do if your extract is not too long.

  • I have some long spreadsheets and want to open them at the bottom instead of scrolling down through all the data. How do I do this?

    I have some long spreadsheets and want to go to the bottom to add new data without scrolling down through all the old entries. When I open a table now it goes to the top row and I have almost 300 rows to scroll through. I would like to set the table up to automatically go to the bottom row.

    Zach,
    You have a couple of options. If you use 100% View Zoom, and if you leave a cell selected in the bottom row of the table when you Save and Close the document, it will reopen with that cell in view.
    You could also sort your table in the opposite order and add new rows at the top. Then you wouldn't have to worry about what zoom you use. To insert a row at the top, select a cell in the current top row and press Option-UpArrow. That will add a new blank Top Body Row.
    Jerry

Maybe you are looking for