How to move a particle system with arrow keys?

I have a little "ice fountain" particle effect and I want to
be able to move it like an object. How do I use actionscript to
effect a group particle system? (or have collision detection
features for that matter)
Code:
this.createEmptyMovieClip("holder2_mc",
this.getNextHighestDepth());
for(i=0;i<50;i++) {
var k:MovieClip = holder2_mc.attachMovie("ice","ice"+i
,holder2_mc.getNextHighestDepth());
k._y = 350;
k._xscale = Math.random()* 55 + 35;
k._yscale = Math.random()* 55 + 35;
k._x = Stage.width/2 -150;
k._rotation += Math.random()* 90 -45;
k.gotoAndPlay(Math.ceil(Math.random()*16));

fixed:
holder2_mc coordinates had to be loaded outside onEnterframe
and outside the "for" but inside an onLoad, and the initial k
coordinates had to be shut down.
------------- Code --------------------
onLoad = function(){
holder2_mc._y = 350;
holder2_mc._x = Stage.width/2;
onEnterFrame = function(){
if(Key.isDown(Key.UP)){
holder2_mc._y -= 5;
if(Key.isDown(Key.DOWN)){
holder2_mc._y += 5;
if(Key.isDown(Key.LEFT)){
holder2_mc._x -= 5;
if(Key.isDown(Key.RIGHT)){
holder2_mc._x += 5;
if(Key.isDown(Key.SPACE)){
//trace(holder2_mc._y);
holder2_mc._rotation += 15;
this.createEmptyMovieClip("holder2_mc",
this.getNextHighestDepth());
for(i=0;i<150;i++) {
var k:MovieClip = holder2_mc.attachMovie("ice","ice"+i
,holder2_mc.getNextHighestDepth());
//k._y = 350;
k._xscale = Math.random()* 55 + 35;
k._yscale = Math.random()* 75 + 25;
//k._x = Stage.width/2 -150;
k._rotation += Math.random()* 90 -45;
k.gotoAndPlay(Math.ceil(Math.random()*16));
//k._y -= Math.random()* 100 +25;
//k._x += Math.random()* 100 -50;

Similar Messages

  • Can't move an object with arrow keys - CS3

    In Fash CS3, suddenly, in certain files, I can't move an object left using arrow keys - but I can move the same object right, or if I hold down Shift + left arrow, it works correctly
    Also - I can move the object down with arrow keys, but not up
    Workaround - move an object on a different layer, then return to the problem object and it moves correctly. But this doesn't last long, the problem resurfaces.
    Does anyone have a solution for this? (I've tried rebooting; tried copying all the layers into a new file - no help.)

    Now, working in the same file, I just clicked on a stroke and it changed the stroke from a smooth curve to angular lines.
    I suspect this file is corrupt. Any thoughts on how to salvage the weeks of work that have gone into it? Every version of this file has the same issues.
    Thanks for any help.

  • How to make a first-person style game with arrow key movement?

    Hey guys, I've made some simple click-to-move 1st person games with AS3, but I just wanted to know if there was a way to move around in 1st person with arrow keys, I was thinking you could get the background to move with the arrow keys, but that would be a little confusing.
    If you guys have any suggestions for me, or if it's possible, please reply! Thanks

    Here is a basic switch usage to move something with the keyboard:
    stage.addEventListener(KeyboardEvent.KEY_DOWN, move_mc);
    function move_mc(event:KeyboardEvent):void {
        switch(event.keyCode)
           case  Keyboard.LEFT : mc.x -= 5
           break;
           case  Keyboard.RIGHT : mc.x += 5
           break;
           case Keyboard.UP : mc.y -= 5
           break;
           case Keyboard.DOWN : mc.y += 5
           break;

  • How to change the presets in pop-up menus (CS6 or CR 7, example Photo Filter) with arrow keys?

    How to change the presets in pop-up menus (CS6 or CR 7, example Photo Filter) with arrow keys an see at the same time the changes on the photo?
    It worked under Windows, now I use OS 10.8 and have to apply a preset with a click or Return button but after that the pop-up menu close so I have to open it once again to change a preset. Please help. Thank you!

    The filter panel is a shortcut for the content panel and it only effects the content of that window. So if you have a folder it will only see this as a folder and not with its content. (a Stack behaves about the same, being different in only counting the first file in the filter panel criteria but not what is in the stack itself)
    You have a view work arounds, first is use menu view / show items from subfolders (this can take some time especially if you have not used caching before on this content) and this builds visible thumbs for all content and that can be used for filtering.
    Or use the find command (Edit / find) and inhere specify the source and fill in the criteria include subfolders and this will give you the correct result.
    When you create a smart collection the find command also pops up given you the same opportunity to get the results in a collection, but since a collection is only a bunch of aliases referring to the originals you might be a bit careful with editing and deleting.

  • Indesign : how to move a rectangle object with his content ?

    hi
    i develop an indesign extension with flash builder and cs extension builder 2.
    when I move a rectangle object containing an image with the geometricBounds property the image does not move and is not visible anymore ...
    how to move a rectangle object with his content ?
    thanks
    Simon

    Use rectangle.move()

  • Artifacts when moving object with arrow keys.

    Hi all
    hope this is the right place to post this question.
    I want to to write simple arkanoid game in Flash (AC3). I've managed to write code that  moves my paddle with arrow keys. The code looks like this:
    function OnNewFrame(event:Event):void
        if (input.IsLeftHeld)
            if (paddle.x > 0)
                paddle.x -= 10;
        else
        if (input.IsRightHeld)
            if (paddle.x < stage.stageWidth - paddle.width)
                paddle.x += 10;
    It works but the result is ugly. The animation is not fluent, there are times when paddle stops for a moment . Also when speed of translation is high (here it is 10) you can see that paddle is flickering at the ends, it looks like single buffering problem. You can see both of those effects here:  http://www.flash-game-design.com/flash-tutorials/movOb.html , hovewer flickering is less visible due to small translation amount.
    How to fix this? How can i enable double buffering (or maybe it is enabled by default)?  Any help will be appreciated.
    P.S. sorry for bad english

    Thanks for samples, this is very kind ; p
    Hovewer you are doing everything almost exactly as I'am doing. Tou are using mySymbol.x++ which means your translation speed is 1. Also I'am aware that rising frame rate will result in smoother animations, but this is not the point. So once again, my flash applications suffer from two problems:
    1) Animations are not smooth. You can see this crealrly in here: http://www.kirupa.com/developer/actionscript/hittest.htm  , go back to the very bottom of the page, there is an animation window, look at the smallest circle. It looks like its blinking. 
    2) Moving symbols with arrow keys with the method i've presnted in the first post (the same method that infeter uses ). Moved symbol is randomly stopping for the very (very very) short amount of time. You can easily spot this in infeter sample.
    Many sample applications i've seen suffer from those issues. and nobody seems to see the problem, so maybe I am delusional? ; p
    cheers and thank for help

  • Moving anchor point with arrow keys crashes Photoshop CC

    Hey guys,
    I've recently run into this bug many times while working with shapes. Don't really know what initiates it but it's super annoying as it crashes the PS CC completely without possiblity of recovering the unsaved files.
    The bug appears while working with shapes after file is saved and reopened. Because I use to design pixel-perfect UIs, I work with arrow keys a lot to be sure every pixel is in the right place. So after selecting one or more anchor points of shape and hitting any arrow key (to move it by pixel), photoshop immediately crashes with this super-long description of bug: http://justpaste.it/ccshapecrash
    Dunno why but this occurs very often when handling 1px-thin rectangles.
    Is it only me or has anybody else experienced this as well? Any idea what exactly is causing it or what might be wrong with my config?
    Never seen that kind of error in Photoshop before. It completely destroys my everyday workflow

    I have exactly the same problem and I don't have any solution. I was tried to update the latest video drivers - nothing! Tried to update Photoshop which updates fixes bugs - nothing! The problem continues.
    My OS is Windows 8 64bit, video card Nvidia GT 630. For the case, my Photoshop 32x works better (faster) than the 64x. Why is that ? I hope to have a solution.

  • Moving Sprite with arrow keys, simultaneous directions

    Hi everyone.
    I'm trying to create a small arcade style game, you control a
    small ship, shoot at incoming targets, try to dogde their shots,
    etc. I'm working on the ship's movement right now, using the arrow
    keys to control it. Getting it to move one direction at a time is
    easy, but sometimes I need to move it diagonally, otherwise I think
    gameplay will suffer considerably.
    I have tried several things but I never seem to be able to
    tell Flash that two keys are being pressed simultaneously. Can
    anyone tell me how I might achieve this?
    Thank you.

    This format should allow detection of multiple keys at once:
    stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
    function keyPressed(ev:KeyboardEvent):void {
    var pressedKey:uint = ev.keyCode;
    if(pressedKey == Keyboard.LEFT) {
    leftDown = true;
    if(pressedKey == Keyboard.RIGHT) {
    rightDown = true;
    if(pressedKey == Keyboard.UP) {
    upDown = true;
    if(pressedKey == Keyboard.DOWN) {
    downDown = true;
    ship.addEventListener(Event.EnterFrame, moveShip);
    }

  • Has anyone figured out how to get speech recognition working with sticky keys enabled on mountain lion?

    I'm trying to use speech recognition to input text on my iMac running the latest mountain lion, 10.8.3.
    I have sticky keys enabled.
    When I try to start speaking by pressing the function key twice nothing happens. I can only get it to work if I disable sticky keys.
    The same problem occurs with all the other modifier keys as shortcut, they do not work with sticky keys.
    When I try to select a different shortcut, I am unable to select a two key combination, but am limited to one.
    If I select the F6 key, or any other single key, I am able to start speech recognition. However the second time that I press the key, it does not stop recognition and process my words. Instead, it restarts the recognition.
    Has anyone figured out how to get speech recognition working with sticky keys enabled?
    Or a way to get an individual key shortcut to start on the first press and process it on the second?
    Or a way to get key combinations to work, as specified by the help:
    Dictation On and Off
    To use Dictation, click On.
    When you’re ready to dictate text, place the insertion point where you want the dictated text to appear and press the Fn (function) key twice. When you see the lighted microphone icon and hear a beep, the microphone is ready for you to speak your text.
    Shortcut
    By default, you press the Fn (Function) key twice to start dictation. If you like, you can choose a different shortcut from the menu.
    To create a shortcut that’s not in the list, choose Customize, and then press the keys you want to use. You can press two or more keys to create your shortcut.

    I noticed with version 10.8.4 of OS X that I am now able to select F6 to activate, and the return key to complete the speech recognition. This is still different than the description of how these should function that's included in the help, but at least it's an improvement.

  • How can i connect the mac with internet key?

    how can i connect the mac with internet key?
    I try but it tolds me that I haven't the javaruntime...

    I try, but to run javapreferences computer told me that I must have a Java runtime... thankyou

  • Premiere CC Frame stepping with arrow keys

    Why can I no longer step ahead or back one frame at a time with arrow keys after updating PremiereCC software?

    It's working here for me xAndyx. Can you try trashing preference? Press Shift + Option and restart Premiere Pro (warning: you'll use any custom kb shortcuts, workspaces, etc.).
    Thanks,
    Kevin

  • I can no longer move an object with arrow keys

    Pretty sure I have inadvertently disabled the option to select an object and move it with the arrow keys on my keyboard, but cannot figure out what I did - or how to enable that option again.
    Illustrator CC
    27" iMAC late 2013
    OS 10.9.5

    Found the answer in another thread. Somehow my keyboard increment was changed to a measurement so small (.00002") that I couldn't see the object move, nor did the X & Y coordinates change. I did not change this preference to .00002", but it is now fixed.

  • CTI Doesn't Move with Arrow Keys PE12

    I am running into a glitch in Premiere Elements 12. When I nudge the CTI (playhead) using the arrow keys it moves only 1 frame no matter how many times I press the over arrow. The audio continues to scrub and the time indicator continues to change for each frame, but the CTI itself is stuck and no longer represents the proper location.
    Anyone solved this?
    I am using a MacBook Pro running OS 10.8.5.

    Thanks ATR for you reply, here I will try to explain my findings.
    My hw. sw. setup
    MACBook Pro, OS X 10.9.4, 16Gb, licensed Premiere Elements 12.1 upgraded from 12.0
    Just to confirm....are you saying that if you do just a one tap on the right or left arrow key, the Timeline Indicator will move 1 frame.              YES (if slow repeat).
    But, if you hold down and continue to hold down on the right of the right or left arrow key, the Timeline Indicator will not go into a continuing movement?     YES.
    >> Today I have found that this problem only show up in ”Expert” edit mode and not in ”Quick” mode.
          1. Current Timeline Indicator (CTI) only move/jump one frame when I first start to hold right or left key pressed, after this first jump CTI will stop to move,
                my movie and time counter will move and count as expected.
          2. If I repeat pressing right or left key with a speed faster than one press per 3seconds the CTI will be stopped,  slower repeat than every 3 second then CTI will move on every key press.  
          3. Note1   when CTI not move during continue key press or fast repeat R/L (< 3sec) the accumulated new CLI position will show up as a long jump on next press after 3sec paus.  
          4. Note2   I have also verifies with my Win7 friend with a new installed PE 12.1 running just fine without this CTI problem.  (MAC version only??)
    If so, several things that I would like you to do if you have not already....
    1. Delete the Adobe Premiere Elements Prefs file which should be found
        Users\Libraries\Application Support\Adobe\Premiere Elements\12
    >> After I delete the Adobe Premiere Elements Prefs file I did restart PE12 program and created  a new project ( an new PE Prefs was automatic create in the same directory as expected)
          But unfortunately my problem is still there.  
    2. In the opened project, go to Edit Menu/Preferences/General and experiment with the Timeline Playback Auto-Scrolling Options (No Scroll, Page Scroll, and Smooth Scroll).
    ATR Premiere Elements Troubleshooting: PE12/12.1: Timeline Playback Auto-Scrolling
    >> Thanks, here I found lot of good reading but your suggestion to change the Timeline Playback Auto-Scrolling Options did change scrolling behavior,
           unfortunately my problem is still there. 
    I am strictly an Elements Windows user, so please double check the translation of the suggested locations from Windows to Mac.
    How would describe your issue - "it worked before but not now" or "it never worked before".
    >> My best answer must be;  I have not seen this problem before but I´m trying to learn video editing so I could have missed the CTI behavior.
    Looking forward to your follow up.
    Thank you.
    Add On...Like the originator of this thread, are you working with a tryout of Premiere Elements 12/12.1?
    No this is a licensed version 12.0 upgraded to 12.1
    Summary:
    My conclusion must be that this CTI behavior is a software bug  (maybe only in MAC versionPE12 or in  some combination).
    How to fix my problem:
    Will a reinstall likely fix the problem?
    Or is´t a case for Adobe Support to handle? 
    I´m happy for any help here.
    Regards.
    Per

  • Moving Movie Clips with Arrow keys

    How do i make it so when i click the left arrow key, it will
    change the movie clip to make it turn around?

    Yes, that's what the code I gave you is intended to do....
    you replace that code with whatever action you need to take to turn
    your movie around.
    I have no idea what your movieclip is doing, but I'm guessing
    by your response that if it was an arrow pointing left to right
    (just an example), you want it to be pointing right to left when
    the left arrow is pressed. If you want an immediate turn around,
    then the simplest way to do that is to have another frame
    containing the movieclip that it moves to where it faces the other
    direction--and to have it appear turned around, from the toolbar
    you select Modify -> Transform -> Flip Horizontal.
    So the movieclip would live inside another movieclip that has
    two frames with stop()'s for each frame. In the first frame you
    would have the subclip facing left to right, and in the second you
    would have it facing right to left. If we call that 2-framed
    movieclip "walker", the code I provided before would
    become...

  • How we can integrate ep system with SAP R/3 system

    I want to integrate SAP EP(7.0) system with SAP R/3.Can any body guide me the step by step method to integrate the above two system.
    How we can configure SLD with J2EE engin?How we can established the JCO connection?
    Thanks
    Kundan

    Hi,
      Why don't you use search functionality in SDN? You can get lots of guides. This question is repeated lots of times.
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/ep/how%252bto%252bconnect%252bto%252bsap%252br3%252bsystem%252bthrough%252benterprise%252bportal%252b7.0%252busing%252ban%252biview.
    Configuring SLD in Sneak Preview SAP NetWeaver '04 Sneak
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c0c1d495-048e-2b10-babd-924a136f56b5
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/3d7db2e5-0601-0010-4a88-9f3498f8142f
    Regards,
    Harini S

Maybe you are looking for

  • Missing RAW editing screen in PSE8 Trial version

    Can anyone help me with this one? I have previously used PSE6. When opening a RAW image I have first gone through a RAW Editor screen before editting in PSE6. When I open a RAW image in the TRIAL version of PSE8 it takes me straight to the PSE Editor

  • Send/import an .ics file  to iCloud calendar?

    Can I send/import an .ics file sent to my iCloud email to iCloud calendar? This .ics file is being sent from Outlook 2010.  Can import on my iPhone and iPad, but not online.

  • MTU vs MSS

    I have been reading up on DMVPN and noticed the tunnel configuration had the following: iinterface Tunnel0 ip mtu 1408 ip tcp adjust-mss 574 Would someone be able to explain to me why the mss is so much lower than the MTU. I thought the MSS was 28 le

  • MS Office 2011 won't install under Mountain Lion

    Today I upgraded from Lion to Mountain Lion. However, my MS Office 2011 refused to run, didn't even start so I couldn't check for updates manually. I had it set to check for updates automatically by the way. So I uninstalled MS Office and then reinst

  • It doesn' t open PDF files

    I can' t open PDF files and sometimes it doesn' t open some issues from different webpages