so I'm still pretty new to AS3, but I'm making a game for my final project in school. I have to make a side scrolling beat em up game, where you hit the X button to do three different attack animations. I want the next attack to not start until the last ends, and I want the attack animations to reset if you wait too long between X presses.What I've gotten so far works, but is very clunky and I already see reasons down the road for why it's not gunna work well.
ActionScript Code:
var attackTimer:Timer = new Timer(1000);
var attacks:Array = new Array();
I am currently making a game, similar to StreetFighter,where enemies will come on from the side and you fight them. Now i have the character movement and attacks fully scripted, and have made an enemy, and i make it move towards the character using:
Now this works quite well and the enemy stops when it hits the character, but the problem is, it wont complete a full attack, instead it plays a few frames of the attack MC. Now i have every attack in a different MC (Frames 2-5) inside the Enemy MC. How can i make the enemy pause when it reaches the character, then choose an attack to use? From there i'll be on my way and can script the hittest and so forth.
The problem I'm having is trying to figure out a way so that the "data2" will fill the text field "hint_txt" on ROLL_OVER of that items name in the list.I've tried to placing an event listener into the function that populates the combo box .this populates the combo box label and data with the Loaded XML File. This works
function changeHandler(ev:Event):void { menuText_mc.heading1_txt.text = ev.currentTarget.selectedItem.label;[code]......
I have two combo boxes. The first combo box's data is added through an XMLConnector object, the second combo box, I would like to populate through an on (change) event in the first combo box. The items in the second combo box would relate to the selection made in the first combo box.
I have attempted the following within the Actions for the first combo box:
on(change) { switch(this.value) { case "value1": comboBox2.addItem({Label:"Label",Data:"Data"}); break; } // end switch } // end event
which is not working.
should an event be dispatched by comboBox1 and a listener be attached to comboBox2? I can't find any examples of this on the internet.. but i might be using the wrong search terms.
What i need to do is, In Flash (FlashMX, CS3 or CS4) I need to place 2 combo boxes. by default the 1st one will be enabled and the 2nd will be disabled. First combo box will have country names and the 2nd will have state names. when a user selects the country name from the 1st combo box, the 2nd shuld then get enabled. and when a user selects the state from the 2nd combo box, there will be button next to it for clicking. on clicking the button, the values in each combo box shuld be selected and the user will be taken to a specific URL which will have the contents on current selected state in the current selected country.
if is there some action scripter who can points to us how we can use a form with combo box, check box, and radio button (group radio button) in action script 2.0 along with the php code
I have a screen with 6 buttons. Only 2 are to be clicked in order to do something else. How can I do an event after having to click the 2 proper buttons?
I have a heart graphic that is moving along a motion path. how would i script it to make it look like little sparkles are falling from the heart can hand animate it but that is going to take way to long.
I want to know how to make a character attack in a game. I've made a platformer game in which a character moves and jumps and collects the score balls, but the only thing I can't do is make him hit enemies.
I'm a design base student and planning to make some interactive game, but I'm still quite a novice when comes to programming...Hopefully can get some suggestion on how to programme an enemy with some artificial intelligence as shown below:
I'm tring to make a still enemy(char) which will throw random items(star with "R" ) on stage....and the character I'm controlling need to dodge the random items that throw towards him. The programming process went on quite well, but I just realize I can't figure out how to throw the items randomly within the given angle (90 degrees)
So far I'm only alble to shoot items in 1 direction only but not in random directions (like those classic jet fighter game). I try google for the solutions but all require complex math equation which include sin, cos, tan. Which I do not understand at all. Is there a simpler solution which do not involve complex calculation, or workaround method ?
Im trying to make my character attack, the attack animation is inside the character movie clip on frame 4. But i dont understand how to do it? I want him to attack once, if SPACE is pressed. I have tried this:
I have a website with a flex application. The flex application has no user input - except for clicks for navigation. The website also uses no scripting language - i.e. no php, asp, jsp or cfm.
The website just consists of one page which contains the flash file for the flex application. The source code of this page is here: [URL]
I have been advised (by a software program used by my client) that this website is vulnerable to a reflective type XSS attack and have been advised to 'sanitize' all user input.
respect to XSS and would respectfully like to ask that AFAIK there is no user input. What should I sanitize and how?
I'm extremely new to Flash and I am making a website and want to have a single button that when pressed pauses or plays a music file. I was able to create one that works by following a tutorial that I found online but the problem is that the button is on the main timeline so as I move away from it, it stops working. I think that it would work better if I was able to make a movie clip out of the button so that it doesn't sit on the main timeline and will keep working no matter where I am on the timeline. All I need is one button that pauses and plays music when pressed. I also want to be able to have a "music on" line of text and "music off" line of text depending on whether the music is playing or not.
I'm trying to create a button that, when first clicked, will add a MC to the stage. Then, on the second and subsequent clicks will remove the existing MC and replace it with a new one. The code I'm using is:
I'm building a historical timeline app in Flash. The main feature will be an MC containing links to specific event in the history of an organization. The MC will scroll, and there will be a couple ways to scroll it. One type of navigation will be fwd/backward buttons, and I want them to work such that if the button is pressed and held, an MC containing links will scroll w/increasing speed (up to a limit), but if the button is clicked, it will just move the MC a specified amt.
An example of what I want to accomplish can be seen it this HP timeline: [URL]
I think I could do this w/a MOUSE_UP eventListener
I have a small Flash presentation I'm putting together and I've written out the code that I'll need or how it will function at least.My question is... is there an easy way to condense the script so every single button doesn't have like 20 if/elseif statements? This is the code on my main frame:
Code: import mx.transitions.Tween; //import tweening class import mx.transitions.easing.*;[code].....
Now I have to apply this idea to like 50 buttons in different sections. Is there a way that I can just check whats in that container already and then just load that movie out without all the code? I'm going to have to rewrite this thing like 50 times for it to work otherwise.
'm extremely new to Flash and I don't really know how to code yet.. I'm making a website and want to have a single button that when pressed either plays or pauses the music file. I found a tutorial that worked but it has two buttons (one for play and one for stop). You can see the tutorial here:[URL] I'm hoping that someone can tell me how I might be able to change the code so that a single button acts as both play and pause (i.e.; If music is not playing then play, if music is playing then stop).
I am designing a instrument panel and am needing to essentially create an emulation of how the panel would actually work. Right now I have the panel set up to run through a systems test. So I have a button play a movie, and display a verification that the test was successful. On the real panel, you press the same button again to confirm the test. How do you setup the button to go to a different frame than the first time I clicked it? I have come across different possibilities, such as using an "if then" function, but really don't know how to use the syntax, or if that would even accomplish the task at hand.
I currently have a 23-frame multilayered single-scene animation designed to loop continuously which I would like to add to my portfolio. As such, I am adding a Play button, which I would like to toggle to a Stop (or Pause) button. I currently have an instance of the Play button ("playButton") created.
(You can find this at pineboxmovingco.com/gear_redux.swf)
Besides imploring your assistance in providing the code, I must also ask if this requires (and best practice for) inserting an additional frame at the beginning for the ActionScript, as well as where/what layer to add an instance of the Stop button. I would like the movie to be stopped by default, presenting the Play button, toggling to the Stop button, and back to the Play button, each upon release.
I load many SWFs in to my webpage. I need to add a removeChild to my main buttons (HOME, ABOUT US, CONTACT US, etc...) so when exiting from one page to the other all the loaded swfs will be removed.
Is there a way to remove all loaded swfs with one action on a button?
I have buttons that need to be double clicked in order to work when they should only have to be clicked once. Once the button is clicked twice, it only takes one click to work. I have this code on the button itself.
ActionScript Code: on (release) { services_btn.onRelease = function() {
I have a movieClip. It has two children, a rectangle shape on layer 2, and a textfield on layer 1. The movieClip is used as a button.
The problem is that the textField and the rectangle are firing mouse "over" and "out" events individually. I want the movieClip to function like the old ActionScript 2 movieClips--as one single button.
I am creating a "Kiosk" to be used in flash using ActionScript 2.0 with individual scenes. At the end of each scene is an outro and the beginning of each is an intro to give the impression of them all appearing seamless.So on each button I have added the following [code]Frame 180 is where the outro plays to enter the selected scene of that button. I would then like add to this piece of script that I want that button to go to that scene after the outro is played. So it would have something like gotoAndPlay(scene xx);The only other solution I have at the moment would be to make an outro of each scene for each button to jump to but this having 8 scenes it would end up adding up to 64 outros in total.So would there be a solution to simply have each button jump to the one outro then jump to its own scene?
I have an animated storybook that reader moves through each page (scene) with forwardBtn and backBtn. Each scene (in it''s own keyframe) I have placed a voiceover on the time line. When I view movie the forward btn plays scenes and sound correctly. The prolblem is with the back btn, When bacBtn in pressed the previous scene plays but the sound from the other sceane keeps going.actions from back btn below
on (keyPress "<Up>") { // Locate the screen that is the target of the behavior var screen = null;
I'm looking for an AS2 tutorial or template that will show me how to create ONE button that will stop and resume an SWF file that is made up of several composited movieclip elements. I've found several that use two buttons (start and stop), but I would like one that operates like the single sound on/off buttons you see on many sites.
I want to load 2 swf files with a single button click. I'm currently using 2 different functions with different loaders and I call both functions with the same button, but I get error 2025.
I need to load 2 swf files with a single button click. I'm currently using 2 functions, but I get: ArgumentError: Error #2025: The supplied Display Object must be a child of the caller.[code]because I tried to load everything into a single function and when I used two functions I got error 2025.What code should I use in order to load two swf files at the same time, with a single button click?
on loading multiple external swf on single button... I mean on click of next or previous button may I load external swf with different name on targeted instance....?
I have a problem with two functions. This is the story: the user has to press the space button on keyboard when he sees something on screen, then the "rightClick" function is called. If he presses the button when there is something else on screen that is a wrong answer (function "wrongClick" is called). The problem is that when the user presses the space button both function run at the same time.
This is the call of the wrongtClick function on frame 5 stage.addEventListener(KeyboardEvent.KEY_DOWN, wrongPress); This is the call of the rightClick function on frame 10 stage.addEventListener(KeyboardEvent.KEY_DOWN, rightPress);
Both function are very simple: function rightPress(event:KeyboardEvent):void { scorenum += 1; trace ("Right:",scorenum); } function wrongPress(event:KeyboardEvent):void { wrongnum += 1; trace ("Wrong:", wrongnum); //and plays a sound too }