How To Fire A Missile By Clicking
Mar 14, 2009ok, now that i have the cursor and following the mouse done, i need to find out how to fire a missile by clicking.
View 3 Repliesok, now that i have the cursor and following the mouse done, i need to find out how to fire a missile by clicking.
View 3 RepliesI'm making a Space Invaders-type game. Y'know? Arrow keys to fly Space to shoot? Well, shooting isn't working so well. I have two .as files: Ship.as which controls the ship's ActionScript, and Missile.as which is supposed to control the missile. When I hit load it up I get the error: The class or interface 'Missile' could not be loaded.
View 2 RepliesTHIS THREAD IS SOLVED.. Answer lies upon a website tutorial. Final Page on this Thread.So far so good, i've gotten most my as2 to as3.. And coming out good Buttons are working, The only last part im working on is upon shooting, it'll bring in the calls to Fire the missle.. (tracein the button works great).
[Code]...
This is what im trying.. But it says undefined use for addchild.. so im taking im missing somthing..
(the missile is a animation graphic i created).I have made a Missile.as to control what the missle does when its addchild is placed on stage. Problem is, (addchild isnt doing it) and im not sure if its going to shoot out the nose of the hero..
I'm trying to create a homing missile in AS3. Easy enough when you want it to simply follow a point perfectly - but I'm trying to make the rocket have to turn around if the destination (target) bypasses it. Here's what I've got - it almost works, but as you can see it's quite glitchy (particularly if the mouse is to the left of the rocket (seems to work OK if it's moving right). [URL]
Here's my Rocket class:
package {
import flash.display.Sprite;
import flash.geom.Point;
import flash.events.Event;
public class Rocket extends Sprite {
[Code] .....
I have this code to add my missile to the screen PHP Code:
[Code]...
it adds right where my character is but I cant seem to figure out how to get the missile to actual move in the direction the character is facing. heres how it looks [URL]
How to create realistic smoke coming out from the back of a missile flying on stage?
it's for a top-view arcade-type game, where the player shoots a missile from a plane...
Basically, I have a border(line) at the top of the stage so that whenever my ship's missile comes in contact with this line, it is removed and a rebound missile clip is attached.Here is the missile code:
Actionscript Code:[code].....The problem is that the rebound missile always spawns at left of the stage, not wherever the ship missile was removed.I'm not sure if I should attach the fla, action script files, swf etc. to the thread. Also, my flash version is CS5.
I have drawn intersecting lines. The user can click on a region inside the angle formed by the two lines.When the user clicks inside the area, the small region formed by the arc between the two lines showing the angle should change. How can I do that.the region between the intersecting lines is sprite object to dispatch event listener, but the arc is shape object.
View 1 Repliesi already know how to create a simple turret / cannon type game wherein the turret will fix its rotation based on where the users mouse is.. from there, the user can fire bullets which fly into the direction where the turret was pointed at when it was fired..
however, i want to take it a step further and make the turret fire bullets that can follow the mouse as i move it on stage (sort of like a "heat-seeking" missile) .. once i stop moving the mouse around the stage and the bullet catches up / arrives at the mouseX and mouseY, it will remove itself...
below is the code i used for the simple turret / cannon type game. i was wondering what i should add / modify in the code to make the "heat-seeking" work...
[Code]...
I have a VideoProgressEvent on my FLVPlayback but when I test the video I get these in the log:
_streamLength = NaNcalling getStreamLengthcalling getStreamLengthResult(880.821)
In an AIR application, I have a private variable and a setter:
[Code]...
The first time that I set "saveResult" the event fires. But it will never fire again unless I restart the application. If I change the setter to:
[Code]...
I set up some code to record key presses and specific chords. My problem is that I only want the keys to fire once when pressed. This is especially a problem when I require the user to hold CTRL + LEFT for an action.
The user experience is that I want users to hold down CTRL to enter a mode and then press the LEFT key as many times as needed. Currently, the CTRL trace and LEFT trace fire continuously. Is there a way to do a onKeyRelease?
Code:
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
if (Key.isDown(Key.CONTROL)) {
[Code]....
i have a little flash-player with a playlist and so, it plays normally a vlc-mp3-stream but has an extended prelisten-function (wich plays the mp3's directly via http, secured with a password)i've got an array with 2 Sound()-objects (for preloading purposes), the code looks like this :
Code:
playStream = url=="";
if (playStream) {
SoundObjects[SN].load(new URLRequest("http://" + URL + ":8001/MIRstream.mp3?" + Math.random()), sloader);
} else {
[code]....
this works for the vlc stream (which is not continuos), but not for the mp3s on the http-server in my opinion, this doesn't makes sense..except, maybe the recent CSRF-hardcore-paranoia [URL]
PS: i use AS3 with flex_sdk_3.2.0.3794 and flashdevelop (i activated flash10-support, but it still works in fp9)
This may seem totally impossible - but I can't get any script to fire off the timeline. I have been given an fla, big animation about 15000 frames long, and no script will run from the timeline. I have tried everything - reset classpaths, delete ASO file, rebuilt a fresh project from the original project's layers... There are no compiler errors If anyone has experienced this then lend me a hand...I'm about to tear my last piece of hair out!
View 2 Replieshow on earth do you get a timer to fire randomly? I've had little practice with timers but thought this would be a simply task to complete but cant figure out?
i've got a movieclip which"pulses" using the EnterFrame event, but would also like something else happen to this clip atrandom intervals using a timer. i've tried "timer = new Timer(Math.random() * 1000); but nothing - it just fires for the first time at a random time, then at set intervals after that....
how do you get it to randomly dispatch?
when i saw this website. I learn some techniques but i really love that fire effect. how to do that?Or any other program. The site:[URL]..
View 1 RepliesI wanted to use the currentStateChange event in my application but whatever code being called in this event was not executed so I thought may be there's something wrong with my code so I tried testing it on one of the examples in adobe live docs.So I took this example here
<mx:states>
<mx:State name="One">
<mx:SetProperty target="{p1}" name="x" value="110"/>[code]....
And all what I did is placing an alert in both events currentStateChange and currentStateChanging of panel One and I didn't get the alerts when clicking on the panel.I also tried replacing the inline code with a call to a function that makes the alert also nothing happened.
So I had a requirement to add an undo function to my app and I discovered this nifty ChangeWatcher class, but it's not doing exactly what I want and I'm hoping someone knows how.ChangeWatcher seems to monitor assignments to the variable reference. So when I say:
myXML = <xml/>
it fires off it's function just fine and dandy, but when I say: myXML.appendChild(thisOtherXMLVar)
I get nothing, even though the variable changes the reference doesn't so ChangeWatcher doesn't fire off the function.how to get ChangeWatcher to pick up on all changes to a variable?
I have a series of symbols on my stage which represent lamps. Once a frame, I want to randomly select a lamp and switch it on if its off, or off if its on; I already have a working function which does this.
I have tried to use the onEnterFrame function to try and fire this function once a frame, but I don't seem to be having much luck, largely because I do not know how to use onEnterFrame correctly. So I have a movie where my function is fired only once when it is first run.
Me and my friend are making a sidescrolling shooter to learn ActionScript 3. But we can't make our cannon shoot the cannonball. Here is the cannon.as
ActionScript Code:
package com.edwardothesheep
{
import flash.display.*;[code]....
And this is the error it gives:
TypeError:::Stage@1fc34b51 to flash.display.MovieClip.
at com.edwardothesheep::cannon/shoot()[C:UsersIanDownloadscannontestcannontestcome dwardothesheepcannon.as:33]
I am making a custom scrolling list (smart phone like) in actionscript 3 and have the parent contianer catch mouseEvents for MOUSE_UP and MOUSE_ DOWN.Sometimes the mouse up event is missed, maybe one in 20. Does this happen if the events fire to rapidly? I do not want to use the MOUSE_ CLICK event beacuse if the mouse pointer moved at all I want the list to scroll and not catch a Click event.[code]Can I somehow ensure that all events are fired?Or if not can I somehow get mouse button states directly from flash? Not via the mouse event object, but in onEnterFrame().
View 3 RepliesI've managed to design myself a pretty awesome little conundrum and I know there are some kickass Flash peoples here I'm working on site for a friend of mine in class. I built a Flash website for them, but I didn't want to make Flash based MessageBoards and Blogs, so I built those in PHP. You can see the website at: [URL] I can simply link away from the Flash website to the Messageboards [URL] But instead, i want the boards to slide down OVER the Flash website using Ajax and Mootools and Absolute positioning the div containing the Messageboard. That part's not important, what's important is...
How do I get my "the.BOARD:" btn, in the Flash site, to fire the Javascript function that'll make the ajax call and slide the div out over the flash site? Lets say the function is called "moveBoard();" Does anyone know of a way to fire this js function from the CLICK of a moveiclip in Flash? Let me know if anyone needs alittle more information.
Working on an mp3 player that i have cobbled together myself, bit rusty on the as3 so im sure it could be improved in many ways but the it works apart from that i cannot get the SOUND_COMPLETE event to fire at the end of a track, thus playing the next track. I have looked on this forum and others but cannot seem to get this to work
[Code]...
I'm starting to learn classes and I'm doing a class that loads a textfile with a variable, using loadVars, followed by pure html text, then it applies css to the html text and displays it in a target textfield...I'm still new at this as I said so the code is very rough. I've worked out all the little kinks up to now..I'm stuck at one thing:When the text loads, the "loadVars.onLoad = function" is supposed to fire the css function that applies the stylesheet to the text, but I simply can't get the function to run...Is it impossible to call a private function from another private function in a class block?code:
Code:
class LoadHtmlText {
/**
[code].....
What would be the most efficient way to do this? TIA
View 2 RepliesCan I store function names in arrays, which then can be used to fire those functions when that array value is called? So basically - I mouse click, and that += 1 to my num var.
Code:
var myF:Array = new Array("thisone","thatone");
var num:Number = 0;
function thisone()
[Code]....
I dont know how to make a function call from a string value!
I've searched and searched on this but with no exact answer. I have a script for scroll wheel support (which I shamefully purchased due to time constraints) but it only works in Internet Explorer. Can some one kindly look at this script and tell me why the scroll wheel only works in IE but not firefox and safari? From my searching it looks like a common issue but I cannot find a resolution to it.
[Code]...
I am hoping someone has a quick answer for me on this. I am trying to handle a drag event when the cursor leaves the stage. Should be fairly simple with Event.MOUSE_LEAVE, but I am having unexpected difficulties.with:
Code:
this.stage.addEventListener(Event.MOUSE_LEAVE,this.mouseDragReleaseHandler);
I never reach the code in mouseDragReleaseHandler
[code]....
I've never needed it until today but I just found out that the alt key doesn't fire it's own keypress events. I need a way to detect when that key get's pressed - any ideas out there?
View 9 RepliesI have a fieldgoal kicking game that I am making I have the basic game done, but I have some things that I want to add but I dont know were to look to the resources. 1. I only want one football on screen at a time right now as many times as you click it kick's a football 2 I also want the placement of my fire arrow to be in a random location for each kick
View 5 Replies