ActionScript 3.0 :: Make Slotmachine "Hold"?
May 26, 2010
i'm trying to create a casino slotmachine(ish) game. What I want it to do is if 2 of the same icons apear on the Winning line, those two reels will actually "hold" and keep the animation from playing and the mathround from being executed for 1 turn. Just like any given slotmachine you'll find in a casino.
Actionscript Code:
[as]var NOF:int = 12;button.addEventListener(MouseEvent.CLICK,playit);function [code]....
View 1 Replies
Similar Posts:
Sep 24, 2010
I am working on a game that is set up like a slot machine. The first box contains a name, the second box cotains a piece of information about the person and the third box contains another piece of info. Each box has a movie clip in it that contains 10 frames, each frame has text in it (a name or piece of information). There are up and down arrows above the second and third box as the user can control what piece of info is in that box using the arrows (if the user clicks the up arrow they go up 1 fram to different info....if down down a frame to new info.) The first box is not user controled, it has a button that randomly generates the name the player is given with a spin animation.
The goal of the game is to match all three boxes the random name with the 2 user controlled pieces of info. If this happens I want the player to receive 20 points. However, if the player only matches one of the pieces of info to the random name then they should only get 10 points. If they do not match ny pieces then no points are awarded.
I figured the best way to do this would be to give the corresponding correct answers and names matching variable names and set it so if you have 2 matching variables you get 10 points and if you have 3 matching variables you get 20 points (no points awarded for 1 variable because 1 variable alone would be the name). My problem is that I dont know how to assign a frame a variable number and I also dont know if its even possible to do something like this. Am I on the right track or is there a much better way to set up scoring?
View 1 Replies
Oct 13, 2009
I've got a symbol on stage and a button. The button rotates the symbol CCW half a degree. Code: on(release){ mySymbol._rotation -= 0.5;} I wanna add an on (press and hold) action on button so that the symbol will be rotated continuously when the button is on hold.. I can't make this work for over a week now.
View 7 Replies
Nov 25, 2009
I'm currently having difficulty with input text fields. I have a flash file that begins with a form for the destined user to input text. Once they have input their text they click a button to continue and user is now shown a results page comprising of the text they have just entered. This i have managed to do.
However, when users click the 'go back button' to return to the form, possibly to correct a mistake they may have made, it seems that the text that they had entered previously has now been lost, and the input text fields have gone back to their original state.
how i can allow my users to return back to the form to make text changes, and have the form remember what text was inputed by the user and does not wipe the input text fields empty?
View 7 Replies
Jun 9, 2009
Hey i am making a quiz which is going to have 20 questions and i have about 40 question in the questions array. make a variable which will hold the 20 random question so
for eg
var arrQuestion:Array = [ 40 questions in here separated by commas]
var randQuestions:int = arrQuestion.length-1;
but that just sets randQuestions to the arrQuestion's length now how do i set the variable randQuestion with 20 questions that are randomly picked from arrQuestion.
View 3 Replies
Mar 6, 2010
My 1 frame load screen zips by and the next frame plays right away. When I click on a button that goes to another frame, it only goes to the last loaded frame, which is the wrong place. This happens for a few seconds until all the frames are loaded. In the meantime, it looks like my buttons are broken.Here's the code I'm using:
if (this.getBytesLoaded()=this.getBytesTotal()) {
this.gotoAndPlay(2);
}
This is the error I get in the compiler:
Left side of assignment operator must be variable or property.
View 6 Replies
Sep 14, 2009
i want to make some sort of scroll pane that will hold my xmL loaded images ..i have looked at several samples of scrolling panes but they only hold textfield.
View 2 Replies
Sep 20, 2011
I'm making a "master movie" for an assignment and I'm stuck right now. What I've got is an Intro page that will serve at the Parent.swf to load 4 other child swf's upon a mouse click. The problem is I have a theater stage where I tweened an animation to make it appear the curtain on the stage is going up but once it reaches it maximum height....the tween abruptly stops. I want it to HOLD there until a user clicks a button.
How would I make this happen? Here is the page in question: [URL]...
View 3 Replies
Mar 3, 2010
I have a long path that i'd like to use as part of an array, so rather than inserting the full path over and over again, I'd like to create a variable that I can use in its place. Unfortunately this doesn't seem to work for me and i'm beginning to wonder if its possible.
ActionScript Code:
Code: Select allvar path:targetPath= "buttons_mc.platforms_mc"
path.MCName.gotoAndPlay(2);
View 1 Replies
May 28, 2009
My actual project I need a event configuration wherein I can hold a keyboard key down and move mouse. While trying to implement this, I recognized that the flashplayer begins to lag, saving actions in buffer and playback them when the KEY_DOWN event is already over...
For example I have a
PHP Code:
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, false, 0, true);
And in the handler I got only this:
PHP Code:
private function keyDownHandler(event:KeyboardEvent):void {
if (event.keyCode == 88) manoverDrive = true;
}
I also do have a
PHP Code:
stage.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
In this enterFrame I do animation for a movieclip that is animated regarding the mouse and keyboard action and events. Now when I hold down any kind of key the animation of this moviclip gets slown down if I hold down the key for 10 seconds and then lift the keyboard key the mouse movements I made before gets somehow saved and the animation got a playback of the mouse movements. I removed the keyboard eventlistener and the behaviour stays. Is that an official flash player Bug?
View 3 Replies
Apr 15, 2010
when i press on Button and hold down i want to increment.[code]
View 6 Replies
Aug 13, 2009
I have a movie clip that I am turning into a button that when it is clicked it updates a text field with the string that is associated with the movie clip.
Do I have to create an Object on that movieClip and assign a var with the string?
so far I have
Code:
seat1MC.onRelease = function(){
this._alpha = 80;
textbox2.text = textbox2 + seat1MCtext;
}
This way the var seat1MCtext is just added to what ever was already in textbox2.
View 2 Replies
Jun 22, 2010
This seems so simple and yet I can't figure out why my MovieClips won't hold their instance names.[code]And I do this for each button (I know I can do this with XML but nothing seems to work right now so I've broken it all down to see what's going wrong).[code]And the trace statement gives me "instance29" or some such. Can't seem to get the name to stick. I've tried creating getter and setter methods in my button class to access a label property and use that instead of the name but it comes out undefined when I trace. I'm having trouble finding anything on the forums though I'm sure it must be there. Could someone point me in the right direction. I don't need a full answer, just an explanation of why this is happening.
View 2 Replies
Apr 1, 2008
I am trying to figure out how to make a script that allows you to click a button, and once it is clicked, the button remains in it's over state. Then, when another button is clicked, the old button that was in its over state reverts to its off state, and the newly clicked button then appears in an over state. How would I do this?
View 1 Replies
Jul 4, 2010
i have a set of 6 buttons and upon clicking one of the buttons i want to tween the others that were not clicked to fade out. how do i do this? i know how to do the tween part but i dont know how to get a hold of the buttons that are not currentTarget...
View 2 Replies
Feb 3, 2010
A) When I hit the UP key to jump the character continues to move up as I hold the key down.
B) When I stop moving forward the frame of the stickman symbol for walking keeps playing and I want it so the frame labeled "idle" will play when I release right or left.
C) Is it possible to have an action for holding 2 keys at once? I want to have it so i can hold SPACE and RIGHT/LEFT to run.
[Code]...
View 2 Replies
Mar 24, 2010
I have a sound bite (~500ms) and want when a key is pressed and held the sound is played.However, what I appear to be getting is the sound triggered to play every time the key down event is triggered (not suprising & makes sense since key is held down). This creates what sounds like several copies of the sound being played at same time only shifted slightly. Very ugly sound btw.My thought is to have a way that even if key is continued to be held down the sound bite is looped but not overlapped.Tried several things such as using Event.Sound_Complete listener, tracking the position, transformation things, timers, etc without success.
View 2 Replies
Aug 9, 2010
I have an array that's pulling movieclips from my libraray using Linkage IDs. How do I change this so that it's pulling the images from an xml file instead in order to reduce file size?XML file:
Code:
<?xml version="1.0" encoding="utf-8"?>
<gallery>
[code]....
View 1 Replies
Apr 14, 2009
How can I hold the playhead on a frame for a few seconds and then have the playhead continue playing?
View 6 Replies
Feb 25, 2010
I have about 10 as3 coded buttons that use the same AS3 coded parameters to control the font and filters of their text fields. I'd like to create a global function to hold these parameters, and then just call the function within each button, and then also code each button to have it's own myText.text = "blahblah"; I can set up a global function no problem using an external as file, but am having trouble getting Flash to accept the parameters. For example, the following parameters work fine when used within the text fields of the buttons, but as so as I try to put them in an external global function, Flash doesn't like the parameters being external:
[Code]....
View 4 Replies
Apr 15, 2010
when i press on Button and hold down i want to increment _global.lines
nextline_btn.onPress = function() { if (_global.lines<25) { _global.lines = _global.lines+1; txt_lines.text = _global.lines; }
View 4 Replies
Apr 15, 2012
I am trying to have a more dynamic function and would like to allow the functions instance name were it outputs the text to be changeable.for example
function example_function(url,instance_name){
instance_name.text = url;
}[code]....
View 2 Replies
Dec 28, 2009
I have one question about pureMvc. I use pureMvc to build an engine, in the engine init part i have an requirement
1) moduleA must init firt
2) moduleB , moduleC need init after moduleA init complate.
3) moduleD need init after moduleB & moduleC init complate.
4) moduleA , moduleB , moduleC , moduleD all extends Proxy beacuse the four system all need to send notifiation ,but no need to listen it.
But to fit for the requirement I can't use command to do it, because they have ini order and also they need to remember current state(ex: moudelB is init Complate but moudleC is not init complete then can't init moudleD) but command is stateless. The best way I think is use one Mediator to do it, beacuse it can both listen and send notification. My question is :
1) Is this a good way to use one Mediator to do it?
2) If use Mediator is good way, then when it hear first moduleA is init complate
registerCommand(FIRST_MODULE_INIT_COMPLATE , initStepTwoCommand);
sendNotification(FIRST_MODULE_INIT_COMPLATE);
removeCommand(FIRST_MODULE_INIT_COMPLATE);
Need to do things like that way or just do the inti logic in the Mediator?
View 1 Replies
Jul 21, 2010
this is supposed to return an XMLList of Groups anywhere in the xml. This works fine if I have more than one , but fails if there is only one .Am I wrong in my assumption that it should return one? I trace xml..Group.length() and it is 0, but the Group is definately in the xml.Any ideas on how you can get one or more Group nodes from my xml?
View 2 Replies
Sep 6, 2011
I got a for/foreach loop the calls a function inside of it. The prolem is that the function being-called doesnt fininsh it's job before the loop goes over again/ Here is my code:
[Code].....
As you can see i want to add an item (notfriend) in MYFRIENDS unction, "notfriend" is defined inside the loop, but by the time "MYFRIENDS" function finish loading the item already changes to the next item even though i was originally refering to the previous item. Is there a way to maybe hold the FORloop until "myfriends" function finish loading.
I wanted to use Eventlistener on "myfriends" function , but then what do i do to stophold the loop? all i know is BREAK-which destroyes the FOR-LOOP and CONTINUE-which continue the loop from the next iterate.
View 2 Replies
Sep 12, 2011
In my Flex 4.5 application I have a TitleWindow Settings.mxml, which is popped up by the PopUpManager.Once the user has changed some settings, I not only need to save them to a SharedObject, but also to apply them to the main Application itself - so that the changes are visible to the user immediately.For example I need to call its method hideApp(somevalue);
The spark.components.Application does not seem to have any static/singleton methods to get ahold of it.So how do you do it? how to declare, that an MXML file implements one or several interfaces?
package {
public interface Hiddable {
function hideApp(value:Number):void;[code]....
besides the main Application I have a SettingsTest.mxml Application in my project for"unit testing" that particular functionality.
View 2 Replies
Oct 15, 2008
I'm new to concepts of AS 3 but i'm stumbling through it.So i'm looking to the Fourm for some Mentor ship
I have a simple Regular Flash slide show with 4 slides and an intro label. I need my Intro label to have a Timer or Delay event that holds on the "Intro" Label for a certain amount of time before the Timer expires and calls a function that tells FLASH to go on to slide "Slide 1" label.
The trick is i need this delay to run everytime the Timeline is at the "Intro" label as i have an animation playing while the timer or delay event counts down and finally at end goes to label "Slide 1" Can anyone share some simple code snipets that would point me in the right direction to accomplish this using AS3 ?
View 7 Replies
Aug 23, 2009
Im new to AS3 (like 5 hours new) and Im after getting stuck with something Im sure is very simple, but Im just not having much luck finding a solution. Basically I have a button which I want to click and hold and then make a movieclip move up and down the y axis. This is what I have so far...
[Code]...
Im sure Im probably going about it in a bizarre way, Im just trying to do it in a way which makes sense to me. So far its working fine for single clicks, so I click the button and the "upwards" function is called which moves the movieclip upwards by 10. The problem Im having is getting it to move continously when the button is clicked and held. Ive read a few possible suggestions relating to loops and setinterval but I just cant seem to make sense of them in a way that applies to what I want to do. Apologies if this is really simple but Ive literally been teaching myself actionscript for all of about 5 hours in total so far and I just cant seem to get past this hurdle.
View 9 Replies
Aug 9, 2010
I have an array that's pulling movieclips from my libraray using Linkage IDs. How do I change this so that it's pulling the images from an xml file instead in order to reduce file size?[code]...
View 1 Replies
Oct 21, 2010
just wondering is there anyway to have a function that checks if you pressed and held at any point while running the app? Im assuming that you could use the code below. But just not sure how to just target the mouse press function at all times, almost like a keydown function but just for a mouse click.
Code:
_root.onenterFrame = function(){
on(press){ //No clue
[code]....
View 3 Replies