ActionScript 2.0 :: Get Two Different Effects While Pressing Down One Key
Mar 4, 2005what I want to do is that I want to get two different effects while pressing down one key.
View 1 Replieswhat I want to do is that I want to get two different effects while pressing down one key.
View 1 Repliessience I've heard that you are quite experienced in flash I wonder if you would like to help me with a little problem of mine.what I want to do is that I want to get two different effects while pressing down one key.
View 1 RepliesHow can I differentiate between these two actions in AS3? I'm working on a side-scroller,and I want to require the "attack" button to be pressed for each successive attackCurrently you can continuously attack by holding down the attack key. I'm using a standard event listener, i.e.
ActionScript Code:
private function keyDownFunc(event:KeyboardEvent)
{
[code]....
I have two buttons when the user selects both buttons I want to display a movie clip. Basically I created a mouse down event to set a variable name for each button. I also created an on enter frame event that is listening when those two variables are true. When they are true I display a movieclip. how can you press two buttons at the same time and the answer is this is for an air app for ios. So the user can have one finger on one button and another finger on another button when both buttons are selected display something.
I had something along these lines:
Code:
private var _isWinActive:Boolean = false;
private var _item1IsSelected:Boolean = false;
private var _item2IsSelected:Boolean = false;
[Code]....
On to the problem: I have a very simple flash, basically just a photo slideshow. The issue I'm having is this: I have a bunch of photos on the timeline, but I have a button on top of everything, just to give viewers the option to skip that particular scene. The button works, but only when the video timeline has reached the very end of the scene. It won't work before the end of the scene. The button actionscript is the most basic of basic:
on (release) {
gotoAndPlay(scene1)
}
There is probably a better way to do what I'm trying to do, but I simply want to make a variable change its value when I press the arrows keys. For example if I wanted to cycle through weapons, if weapon=0 then the character is holding a certain weapon, then I press the down arrow key and weapon=1 and if weapon=1 the character is holding another weapon. And if I press up weapon=0 again so he's holding the first weapon again. And say there's 8 weapons, if weapon>8 then weapon=0 again so its a cycle. I tried arrow key functions and all they worked for was making a symbol move. I think I knew how to do this stuff in gamemker pretty well but Flash is very different.
View 2 RepliesIm trying to show a new movieclip that only shows up when i press another one.
The movieclips to press are nested inside another movieclip so i need them to call the other movieclip which is in the stage.
To explain better menu1 is inside cont3. Menu_down is in the stage and i need to call it after pressing menu1.
Btw menu1 is showing an external swf also,is there any problem with it?
I'm making a Century club timer, it is to execute on pressing the start button, and then run until finished (our paused, but thats not implemented yet). To keep the timer accurate I had to use the Date() function.The timer() function is used to update the displayed time. I tried using a while-loop for this, but then the whole thing would just freeze. :S So instead a use a infinite timer that ends when currentTime == targetTime.
[Code]...
[code]for the part that says "if(???)" i am trying to get it so if the user presses key+wp(key65) it does an event. how do i do it without having to put it inside onClipEvent
View 3 RepliesI'm trying to play a movie by pressing a keyboard key. "B" for example. It stops playing automatically. But when I press the key again it should start playing from where it stopped.
View 1 RepliesI have a map that I made in flash, complete with up, down, left, right panning, and zoom in and zoom out functions that work by pressing buttons. Is there a script I can slap on the top of these that can make it so when I press and hold down, it continues the action until I release the button?
View 4 Replieshow to activate a hittest with a key. For example, I have my character and I want that when my character is on the door and he presses a certain key he goes to a different frame.
View 5 RepliesWhat im trying to acomplish is to list some mcs by pressing buttons.I got 5 buttons and 5 mcs.If the user press for example 3 buttons the objective is to list that 3 selections in same selection order and if the user deletes the 2nd of the 3 selections the 3rd selection takes the place of the 2nd selection (a population list). I attached a link to the source file.
View 3 Replieshow you would press say three keys at once and be taken to a specific frame?
thats the best i can do and it doesn't quite work, one in ten trys it works so im utterly confused
onClipEvent (enterFrame) {
if (Key.isDown(74)) {
if (Key.isDown(77)) {
[Code]......
I have some movieclips containing mp3s, there is one the main movie clip with the background music playing constantly, and several others with short loops that sound only when u click on them....what I need is that when I clic one of the movie clips containing the short loop the MAin movie clip with the BG music to stop automatically..
View 7 Repliescrouching = false
wp = 65;
MovieClip.prototype.key38 = function() { //down
if (!this.crouching) { //if crouching is false
[code]...
for the part that says "if(???)" i am trying to get it so if the user presses key+wp(key65) it does an event. how do i do it without having to put it inside onClipEvent.
I am trying to create a flash movie that allows the user to click a button and then once he clicks down anywhere on the the stage, an image appears. I know this is possible, just not sure what the 2.0 action script is for it.
View 18 RepliesIs it possible to change one button state, when pressing on another button? E.g.
btn1.onPress = function() {
btn2.setMouseState("Over");
};
The above code does not work though.
I have recently received a copy of the Adobe eLearning suite, in particular I hope to use Flash for the majority of my elearning projects.I have been having trouble using the learning interactions that come ready to use with Flash. For example,I placed the drag and drop interaction onto the stage area, but when pressing F12 to preview and use this feature it would not work (could not drag the movie objects), the same goes for all the other features I can select radio buttons etc but when pressing the 'cheack answer' button nothing happens.Even though these interactions come with instructions which i have followed, it still does not seem to work. I do not wish for them to be scored, I just want the user to receive correct or incorrect feedback.
View 1 RepliesI would like to be able to go from an html page by pressing an enter link then go to a 'preLoader' page which would then automatically load the mainPage. Originally my preLoader was the 'index' page for the site and had a button that would start the loading process to the main site which was entirely a Flash site. But I decided to add an html page chock-a-block with searchable text so people looking for the services this site offered could actually find it and make that the 'index' page. Anyway, I would like the preLoader page to start loading the next page automatically with no user events like mouse or keyboard events needed.
View 1 RepliesIf you press a keyboard key on an ADG the selected row moves to the first line it finds whose first column cell's text starts with the character you just pressed. Does anyone know if there's a property to turn that behavior off?
Here's a simple code snippet that shows this, in case you'd like to play with some code...
<?xml version="1.0"?>
<!-- dpcontrols/adg/SimpleADG.mxml -->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
[Code]....
I want to add to custom MovieClip MouseEvent listener. MovieClip contains some text. When pressing on the part of MovieClip that contains text, listener does not react. How can I change that? I want the whole MovieClip to be clickable.
View 2 RepliesCan an action be initiated through pressing a key combination? Here's a snippet instructing a MovieClip to move right when SHIFT+Z are pressed...
Code:
stage.addEventListener(KeyboardEvent.KEY_DOWN, testFn);
function testFn(event:KeyboardEvent){
if(event.keyCode == 16 && 90){
dot.x += 5;
}
}
Only the first key is recognized, i.e. the dot moves when SHIFT only or SHIFT+Z together are pressed; the swf's ignoring the second key.
This is a script I have to make a menu appear when you press the "p" button:
ActionScript Code:
onClipEvent (enterFrame) {
if (Key.isDown(80)) {
justPressed = true;
} if (Key.isDown(80) and justPressed == true and _root.openmenu == 0) {
[Code] .....
The problem is that the actionscript wont repeat. I can open the menu once, and can close it once too, but after I close it (move it to x and y values of 1000), it can't be reopened.
I have this project and I wanna when pressing on the button the action is executed just once
coz the action is Executed by the number of times you've pressed on .
here is my project :
[URL]
There are 5 movieclips on the stage (btn0 to btn4). I wanted to change focus pressing Keyboard.UP and Keyboard.DOWN. But the focus changes not in correct order. It jumps in mysterious way from 0 to 2 and so on.[code]
View 6 RepliesI have some numericstepper in my movie, I given the tabindex for all numstepper, Its working fine with pressing TAB key, but I need this event also work even if I press "SPACE" key.
View 2 RepliesI'm completly lost, I'm rather new to flash, and I'm trying to get a symbol to move when I press a key. The following is what my code looks like:
onClipEvent (load) {
speed = 5;
} onClipEvent (enterFrame) {
if (key.isdown(37)) {
_x -= speed;
} if (key.isdown(39)) {
_x += speed;
} if (key.isdown(40)) {
_y += speed;
} if (key.isdown(38)) {
_y -= speed;
}}
So I'm making a game which has different scenes. One of my scenes has six buttons, of which need to be pressed in a certain order to progress in my game.
View 9 RepliesIs there some way you can stop certain scripts by pressing a button? I tried making a movieclip that you can toggle by pressing the spacebar, but making it pause all the other graphics won't work.
View 1 Replies