ActionScript 2.0 :: F8 Pause Menu Won't Work With KeyPress
Jan 9, 2009
[code]Is there a way to check for when a key is released? Because here is the problem. It's a pause button, but what happens if you hold it down for too long? First it will check to see if the 'p' button is pressed and that the game is not currently paused. "It's not, ok, pause the game." But since it's checking this same if statement 24 times a second, say you accidentally hold it down too long and it goes through the same if statement again: "Ok, the 'p' button is pressed, but the pauseGame is false. Ok skip that and move down to the else. The 'p' button is pressed and the pausegame is true. Cool, set the game to unpaused." In less than a second it managed to pause and unpause the game because the conditions were correct both times.Is there a way to avoid this error? With a button they have the onRelease to solve this problem. How do I fix it for a keypress?
I'm using Flash CS3 (AS2.0) at school on a mac, but when I open the file on CS4 on my pc I can't get my keypress to work.[code]I want my animation to happen when I push "t" on the keyboard.I have the whole alphabet to go through but I'm stuck since I can't even get this first one to work!Do I have to convert it to AS3 somehow since that's how it opens in CS4 (I think)?I'm new to Flash and need to figure this out for a course project!
I have successfully made a keypress listener that does an action when the user presses a specific key. The only problem is that it doesn't work until the user physically clicks on the swf.
Is there a way to set the listener to detect a key press even if the user hasn't "activated" the .swf? When I refresh the webpage I'm already in the web browser so the detect should work from the start and the user shouldn't have to click on the .swf to make the keypress work.
Maybe there is no way around this but it'd be nice or if someone knows a work around?
Here's my code stripped down to the essentials:
keyListener = new Object(); keyListener.onKeyDown = function() { x = Key.getAscii();
I have no idea how to make it so that if you press p once, it pops up, and if you press it again, it dissapears.I want it to start off screen and when you press the button it goes to coordinates inside the screen.here's what I have:
ActionScript Code: if (Key.getCode() == 80) { if (_root.pause1 == 1){
I'm creating a game with movie clips that are generated using getnexthighestdepth, and have a pause menu too. However, as the movie clips are generated after the pause menu, they appear above it, partially obscuring it. Is there a way to make the pause menu permanently on top?
i need to find a way to pause and start again from that same position the 'infinite menu' found here on kirupa URL...A friend of mine attempted to help me, and gave me some code to fiddle with. I did fiddle with it, but problem was, the code was for Flash MX 2004. So it didnt work on my MX. Here is the existing code i have, but doesn't function (i.e. works fine when control>Test Movie, but doesnt work when actual .swf from folder is opened)[code]
So i am working on a pause menu for my game. I have an inventory box that has slots for weapons, powerups, and other items. I wanted different boxes that are specific to each type of pick-up (weapons, powerups, other). So I drew a box with 3 frames, it is set up similar to tabs in a web browser; click on weapons tab and you see your weapons in your inventory, click on powerups tab and you see the powerups etc...
In each frame I gave the inventory slots different instance names, i.e. in weapons; weaponSlot1, weaponSlot2, and in powerups; powerupSlot1, powerupSlot2.
When the player bumps into an item, i use gotoAndStop('frame number') so that each item is added to the proper inventory slot. the only problem is that if i bump into a key then pause the game, the key is there (under 'Other' tab), but if i click the 'weapon' tab and then go back to 'other', the key is no longer there.
This makes sense because when you click on each tab, i use gotoAndStop('frame number'), and in each frame the inventory slots are blank, so im stumped on how to keep each item in the proper slots?
I am going to i upload all my files in a zip, the main file that you will want to look at is the PauseMenu.as file
Also you will notice 3 public functions called 'checkWeaponSlots', 'checkPowerupSlots', and 'checkOtherSlots'. These are called in my main file, when the player bumps into an item, these functions are called to check which slots are empty.
I followed lee's tutorial to create my own video player and I'm using AS3 for that. The problem is that for some reason, pause() doesn't work, it will pause the first time I clicked it, but it wouldn't go back and play again. I looked through AS3 books and online, everything tells me that pause() should be able to pause and resume. Another thing is that if I try to use pause(true), an error would appear and tell me that the argument should be no more than zero, and I'm like "why?????" so here's my code, it is basically based on lee's code but in AS3...
I have a slide-show with 3 sections. The slide-show loops automatically as well as when being prompted by a button to go to a particular section. I also added a play/pause button which works initially, however, when clicked on one of the buttons to go to another section, the slide-show resumes looping..I"m assuming I need to check weather the pause button has been clicked to resume/or not resume the slide-show... but I'm unable to figure out how to do that.Here's the code:
I have a slideshow with 3 sections. The slideshow loops automatically as well as when being prompted by a button to go to a particular section. I also added a play/pause button which works initially, however, when clicked on one of the buttons to go to another section, the slideshow resumes looping..I"m assuming I need to check weather the pause button has been clicked to resume/or not resume the slideshow... but I'm unable to figure out how to do that.head of time! Here's the code:
import fl.transitions.Tween;import fl.transitions.TweenEvent;import fl.transitions.easing.*; //Timervar tl:MovieClip = this;var slideDuration:uint = 12000;// or use whatevervar slideTimer:Timer=new
I 'm building a slide show w/ as2, most of the function are fine. However, the pause button doesn't work properly. It can pause the slide show, but not able to play the slide show again. (fyi - the previous btn & next btn work fine !) [code]
I've added an empty moviclip to it. Loaded it to the main stage an add an action so that my menu (which is on a separate movie is loaded on that movieclip) This was fine.I've added a second empty movie clip to that main stage an another action targeting it, to load my logo over that movieclip.This was also fine All this on my first frame of the main movie.The menu located at the external movie, loads data from an external xml file.I need the items on that menu to target a "gotoandPlay frames on the main movie according to the information on the also external .xml file.This menu file originally targets to external .html files and works fine, but when modifying the action script inside that menu file to perform the above mentioned "goto and play" on the main movie, I get no error message when exporting the files, but no action occurs.The main movie I've called it "ska.swf".The menu movie file I've called "miniaturas.swf".The external .xml file I've called "config.xml".[code]
ok, so i know there's a Key.isDown() function, but i need a key is pressed function,i simply don't know the function name, i've tried Key.is Hit (not cussing here, but without the space) and Key.isPressed.i've done some research and the closest i've seen is key.isToggled, but that only works with caps and num lock. the reason i need this is for a simple pause menu activated when "p" is pressed.
I have downloaded a demo of a rotating menu from here: [URL]. But when I go to open and publish the movie nothing happens, it seems like there could be something missing, I can't upload the files as the folder is to large, you can download the files from the link above.
I want to make a button stay in its down state when it's clicked, and I did it for the MC buttons "Objectivity" and "Publications", but not for MC button "Fotography", that trigger the vertical drop down menu. I also want that the MC buttons "Objectivity and "Publications" make the "vertical drop down menu" reverse for it's original state (hide).P.S. Of course, I want all the MC buttons link to their respective URL's.
Im making a OOP game. Using classes ect. But how does the main menu system work? Well Im not full OOP yet i guess. the player spawn point and level boundaries are all visually set up on frame one. But im unsure as how main menu sytems ever worked OOP or not.
This has been bugging me for 2 days! I can't seem to figure out how to get my drop down menu to work. When I roll over my main button the sub buttons tween down into the mask. It looks great but when I move my mouse down to one of the sub buttons of course they slide back up because I rolled off of the main button.I will put my code in here, but keep in mind it is not finished and needs to be cleaned up =)
I have a drop down menu on my website and it works perfectly fine except for some of the links. i don't have the other pages made yet but i still have the links to the pages in the buttons in my drop down menu. For some reason when i click on the buttons in the drop down menu, they don't go to the pages, they don't do anything. But when i click on the buttons in the sub drop down menu in side the main drop down, they work
the code for each button is the on(release) get url code, is their a different code i can use that will make these buttons work? here is the link to the website so you can see what I mean. the paralegal services button is the one with the drop down.
I have a drop down menu on my website and it works perfectly fine except for some of the links. i don't have the other pages made yet but i still have the links to the pages in the buttons in my drop down menu. For some reason when i click on the buttons in the drop down menu, they don't go to the pages, they don't do anything. But when i click on the buttons in the sub drop down menu in side the main drop down, they work
the code for each button is the on(release) get url code, is their a different code i can use that will make these buttons work? here is the link to the website so you can see what I mean. the paralegal services button is the one with the drop down.[URL]
I am trying to get a drop down menu to work in Flash but cannot get the Actionscript to work. I am a novice at Actionscript so I'm not even sure where to start. Basically, I want the menu to drop down when you hover over it. If I can show me how I should start the script, I can probably figure the rest out. I have four drop down buttons that should come down when you hover or roll over. I can't attach the flash file because it is over the file limit.
I'm working on an AIR for iOS iPad scrolling menu with "kinetic" interaction. I'm trying to emulate as closely as I can the behavior of native components. To that end, I've had to forgo the traditional startDrag() method because of the peculiarities of the native UIScrollView. The reason startDrag() won't work for me is that when you drag the menu past its upper or lower scrolling threshold you encounter resistance, that is, the effect of your mouse/finger on the scroll/dragging of the menu is cut in half. Inside either threshold, if you move your finger a pixel the menu moves a pixel. Beyond either threshold, when you move your finger two pixels the menu only moves one because of the a .5 resistance multiplier. As far as I know, startDrag() doesn't account for any of that.
I followed a tutorial for creating a drop down menu with as3 and it worked great, except for the fact that the buttons within the dropdown don't work. the categories in the drop down are converted to button symbols and when you roll over each button text, it's supposed to change from green to grey but when you roll over them, they don't even register as buttons. Also when I move the cursor away from the dropdown slowly it rolls up, but when I move the cursor away quickly the drop down just stays down and then i have to actually move the cursor back on the dropdown and slowly move it away for it to roll up. For it to roll up I have it so the cursor rolls over a box that borders outside the dropdown and menu button and the code tells the box to roll up when moved over the box.
I am by no means an actionscript genius. I took a tutorial online to figure out how to do a drop down menu. It is all visually functional but when I click a sub-menu item it wont work. For example, if I click the "company" tab on my website, there are 2 options: "about us" and "contact us". In my time frame we are sitting on frame 200. I have added the following actionscript to the "about us" sub-menu button:
i have this rectangular menu that's positioned on the bottom of the stage, just 20 pixels above [it's 170 height so 150 arent visible]. when i rollover the mouse the menu rises showing the buttons, and hides if i rollout the mouse.
I have currently created a tree menu that works but I cant seem to get the scrollbar to scroll thought the information. I have attached my flash 8 file.
I have made a drop down menu, that through shape tweening expands when you mouse over a tab...and when its fully expanded...buttons show up...I want the buttons to perform actions when clicked, but as it is now, I cannot get them to simply trace...I have a movieclip named tools on the main stage...this tools movieclip is the one that expands when you hover over its tab...in the tools movieclip I have a button that shows up when the tab is expanded...."jButton" in the main movie...I am trying to access it using the following code...
tools.jButton.onRelease = function()
that does nothing...in the tools movieclip I tried to put actionscript
jButton.onRelease = function()
this does nothing as well...I am trying to make a simple tools menu which will allow the user to print or save the contents of a movieclip...as as soon as the buttons perform any action I can go on to coding the ideas above...
Im working on migrating an old as2 file to as3 and am stuck on a swapDepths issue--Havent had any luck with setChildIndex or swapChildren--Nothing is being dynamically added to the stage and as the clips are nested and consist of timeline layers of textfields and MCs Im not even sure what is a child of what. for some reason on mousing over the menu, the code I have for highlighting the button and showing the text that was appended(on long lines of item descriptions) due to size constraints of the component, is showing up as semi-transparent--I dont understand what is causing it to happen(although I resolved the issue previously with swapDepths)or how to resolve it. The code thats is the issue is in the menuButton MC timeline layer 13...
Here's the link to the file--see button 8--- [URL]
I have a 'dropdown' menu (that actually goes up...) with 4 buttons inside of it. The menu's bg is just a movieclip containing the buttons. The problem is, when you mouse over a button the dropdown menu retracts. How do I get flash to consider the buttons to be part of the background, so it doesn't think you're mousing out when you try to hover over the buttons?Heres a link to the FLA and some of the code. I've been trying to get it working for over five hours and I'm getting extremely frustrated.FLA: [URL]
I purchased a website template that has some flash in it however the auther of the template lacked to include instructions and seemed to have left it unfinished (The links don't work, of course).
I can't seem to locate the actionscript he talks about: [URL]
[code]....
Notice that nothing there with clickable links :
I cannot find the actionscript that deals with onRollOver actions I would be absolutly ecstatic.