Game action script glitches

Please find attached a link to "shooting fla" with action
scripts modified from
"snowman fla" which has2problems: 1. the gun and crosshair
should follow the same path. 2. the bullet should shoot from
gun but does not.
These actions work in the action scripts for the snowman.fla
where the code was derived.
shooting files
Thanks in advance
shooting.zip
shooting.zip

you can't control where the hidden mouse is located. you can
control where you sight is located.
so, if you want the mouse to be at the lower left of the
sight, place the sight movieclip at the _xmouse+whateverX,
_ymouse-whateverY. though, i can't think of any reason you would
want to do that unless you just want to aggrevate your users so
they shut down your game sooner rather than later.

Similar Messages

  • FlashGame, "sniper"-game, Action script help!

    Hello!
    I was trying to create a simple shooter game in Flash.
    And i want it to be very simple and not good looking if you
    now what i mean.
    Now to my problem.
    The game is all about to aim at a target and then fire/click
    and if you have hit the target, it should go to another frame. I
    want it to go to frame 5 after that you have hit the target.
    The sight is very simple, it´s a circle whit a cross in
    it. And it have a transparent background.
    The mouse is "hide" and the grafic (sight) show instead.
    BUT the moues is not "hide" in the midle of the sight. I want
    to decide where the mouse should be hide in the sight.
    I now that it can be hard to understand what i mean,
    so download the FLA file so that you have a better overview
    of my problem.
    http://rapidshare.com/files/90288167/SkjutTest.fla.html
    Please take time and help me solve my problem.
    Sorry for my eng. , i´m Swedish.
    Thanks!
    //SweFille

    you can't control where the hidden mouse is located. you can
    control where you sight is located.
    so, if you want the mouse to be at the lower left of the
    sight, place the sight movieclip at the _xmouse+whateverX,
    _ymouse-whateverY. though, i can't think of any reason you would
    want to do that unless you just want to aggrevate your users so
    they shut down your game sooner rather than later.

  • How to embed html codes for videos games etc... in action script 3.0

    i am trying to embed a chatbox on my action script 3.0 website. but i am having no succes. any help on how to get my chatbox on a page using html code

    Hey thnx Ned.
    this sites are really helpful.but,i have used sound through button.so how it is possible to attavh the link with slider.i have created slider also.
    Below is my slider code for sound.
    onClipEvent (load) {
        mySound1 = new Sound();
        mySound1.loadSound((myScale)+"/"+(myTanpura)+"/"+(myTanpuraSwar)+"/"+(myTanpuraTempo)+".w av", true);
        mySound1.onSoundComplete = function() {
        mySound1.start();
        mySound1.start(0.058,999);
    onClipEvent (enterFrame) {
        downloaded = mySound1.getBytesLoaded();
        total = mySound1.getBytesTotal();
        if (downloaded != total) {
            _root.dl = "You have to buy this software...";
        } else {
            complete = 1;
            _root.dl = "";
        mySound1.setVolume(ratio * 2);
    This code is working for slider.I mean it scrolls the slider.but it dosent make any effect to sound.
    Below is my button code.
    stop();
    mySoundBtn4.onRelease = function () {
              mySoundC = new Sound(this);
              mySoundC.attachSound("mySoundClip4");
              mySoundC.start(0, 300);  //10 represents the number of loops
              gotoAndPlay("play1");
    this is on button's frame.not exactly on button.
    Button and Slider both are on diffrent scene.
    Can you plese help me out?

  • Impossible migration to action script 3

    I have my entire history of Flash files that open in the new version of Flash with all the old scripts erased.
    How do I even identify which scripts have been erased in this new version?
    I have games and a VJ system that i built and still regularly use.. both of which are now static and worthless.
    Do i have to rebuild all of these from the ground up with Action script 3?
    Steve

    If you can`t get on your hands on a version of CS6, which is the last Flash version which supported AS2, than you have to decompile one of your working swf-files with a decompiler, which will at least parse all the code you put on the timeline.

  • Action script flash

    hello
    i have made one touch screen frame using infrared for my project i am a U.G student of electronics and communication and i have made this touch screen frame to count the coordinates so i passed my coordinates to com port and i want to pass this coordinates to flash action script game called wall pong but i dont know the flash action script as i haven't studied the action script so how can i pass this coordinates to flash i can able to pass the coordinates to net port .but from that i couldn't pass it to flash game i have download the code from the internate. but i couldn't understand. what should i do??? can any one help me out??

    to communicate with any kind of non-standard hardware you will have to run some kind of virtual server that listens to your device and prepares it for flash.
    Look into WiiFlash, it manages to get Flash communicating with a WiiMote:
    https://code.google.com/p/wiiflash/
    It will certainly give you an idea how to jumpstart your won project

  • New to flash / action script 3

    hi guys,
    got sick of playing flash games and want to learn to create.
    i downloaded a gif of sub zero from mortal kombat...the gif has all the frames for each action like jumping / punching etc.
    i have imported it into flash and i have organised the key frames so when i press enter it looks pretty smooth.
    will i be able to control it like this with keyboard using action script? or do i have to convert it to a vector graphic?
    or is this just not possible.
    can anybody please recommend me a good flash/as3 book to read please...i know there are lots...
    thanks
    jonininireland

    imm for an easy gif control try to import it as a movie clip , Gif images must be framed inside your - character Movie clip -
    try to learn about cross images technique for animating chracters.
    of course u'll be able to control game by keyboard ha ! .
    see:http://as3gamedev.blogspot.com/
    Read :Essential Guide to Flash Games
    try:Develop Flash Games
    Good luck
    Mhood

  • How do I use the button states in an action script?

    In my Captivate 8 project I use smart shape as buttons. The buttons have different images presented dependent on the state of the button. I have also created a simple action script that shows what happens when the button is pressed. When the button has been pressed the normal state of the button appear. I, however, want the down state of the button to remain visible util the user presses another button. How do I accomplish this? Is there variables for the buttons different state or how can I create that?
    BR,
    Madeleine

    When you talk about 'actionscript' do you mean advanced or shared actions? You cannot write actionscript within Captivate, only Javascript. If you use advanced/shared actions they'll be converted on runtime to either Actionscript (for SWF output) or Javascript (for HTML5 output).
    The states in shape buttons are the normal way buttons behave (not only in Flash). If you are indeed using shared/advanced actions, and you want the down state to remain until the next shape button is clicked, you'll have to go the way described by iFlashAppsToo. Create shapes that have the look of the down state, make them initially invisible and group all those shapes on one slide. Add two statements to the shared/advanced action (please do use shared actions, you'll save time):
    Hide Group   so that eventual down mimicked states on previously clicked buttons disappear
    Show Im_Downx    to show the down image for that button

  • Adding data to cfgrid using action script

    how can i add data to a grid row called name in action
    script. i have a cfselect control containing name of students and i
    want to add the values of the selected student from the list to
    grid.

    Did you add your instance of SpectrumCanvas to the stage with addChild()?
    If so, you should boil your posted code to a more simple example.
    If this post answered your question or helped, please mark it as such.

  • Error message with Action Script 2.0 file

    Hi,
    I am trying to edit an old flash file that uses Action Script 2.0. I am using CS6 and keep getting the following error message after publishing:
    Scene 1, Layer 'AS', Frame 1, Line 5, Column 29
    1067: Implicit coercion of a value of type int to an unrelated type String.
    Can you suggest any fixes or workarounds? I also have Flash 4.0. Can i downsave the file? If so, how?
    Thanks!

    Thank you. I think that did fix the original two errors. But now upon test of the file, I get some new errors:
    Symbol 'MoneySlider', Layer 'AS', Frame 1, Line 7, Column 3
    1120: Access of undefined property ratio.
    Symbol 'MoneySlider', Layer 'AS', Frame 1, Line 7, Column 20
    1180: Call to a possibly undefined method number.
    Symbol 'MoneySlider', Layer 'AS', Frame 1, Line 7, Column 27
    1120: Access of undefined property _root.
    Symbol 'MoneySlider', Layer 'AS', Frame 1, Line 9, Column 27
    1120: Access of undefined property ratio.
    And on the MoneySlide layer in Actions:
    this.ratio = 0;
    this.loadBar._width = 0;
    this.dragger.ratio.text= "$0";
    dragger.onPress=function(){
              this.startDrag(true,0,0,line._width,0);
              this.onEnterFrame=function(){
                        ratio=Math.round(number(_root.transitBenefitLimit/100)*(this._x/(line._width/10 0)));
                        loadBar._width = Math.round(this._x);
                        dragger.ratio.text= "$"+ratio;
    dragger.onRelease=dragger.onReleaseOutside=stopDrag;

  • Using action script 2 how can i send a variable value to a dynamic textbox on a different keyframe?

    using action script 2 how can i send a variable value to a dynamic textbox on a different keyframe?

    Thanks for your swift response.
    That sounds like a good solution, but the code I have on frame 2 is this
    timer = 0;
    countup = function(){
    timer++;
    countupInterval = setInterval(countup,100);
    If I added the same actionscript to frame 3 which has a dynamic textbox with a variable timer attached wouldn't it just put the timer back to 0? What I want is the last known value that was given when it was in frame 2.
    I am thinking of temple run here, I am trying to caculate the total distance(set in the timer variable) from the previous try.
    Hope this makes sense.
    Chazwick

  • Error while loading an child movieclip if the child has any action script

    Hi
    I am developing an application where I need to load a child.swf . All works fine when I load the mc but as soon as I add Action Script (lets say trace("test")) to the Child.swf I get a Error #1009: Cannot access a property or method of a null object reference. On the addChild line.
    Code
    trace("Toothpaste click");
    var mLoader:Loader = new Loader();
    var mRequest:URLRequest = new URLRequest("Child);
    mLoader.load(mRequest);
    mcContainer.addChild(mLoader);

    Sorry.Thanks
    Typo on the forum.
    I can load the child.swf see the image/text in the child  displayed in the parent but as soon as I add as3 to the child page I receive the above mentioned error. If I run the child.swf from the IDE or by itself everything works fine .
    trace("Toothpaste click");
    var mLoader:Loader = new Loader();
    var mRequest:URLRequest = new URLRequest("Child.swf");
    mLoader.load(mRequest);
    mcContainer.addChild(mLoader);

  • Could someone help me with my action script?

    I followed a tutorial on how to make an interactive photo gallery but for some reason the file isn't working. I am new to flash and no very little about action script.
    Would someone be willing to take a look at my file and advise me?
    Thanks

    Did your tutorial have you download XML from a server to feed the images to the gallery? Many people forget to check for errors loading the XML file or forget to "do something" once the XML is loaded. Common things not to look for are IOErrorEvent.IO_ERROR or SecurotyErrorEvents warning you the XML you're trying to load is on a different domain (a webserver online) and it doesn't have permission (a crossdomain.xml).
    In those situations it can appear like it's doing nothing.
    Did you just take the code of the tutorial at the end and try to play it as you went through the tutorial? If you just copy and pasted it all you'lre going to have a hard time isolating the issue. In that case you can always re-do the tutorial until you start to see issues. Then you know where they are.

  • Setting timeout settings for Action Scripts

    We are using OIM 11gR1 along with the AD and Domino connectors. We are also using Action Scripts to perform some post create actions on the AD and Domino resources that get created by OIM. The action scripts are being invoked with the correct set of parameters and they do their job. However for both connectors, the connector server (Java connector server for Domino, .NET connector server for AD) times out when waiting for the script to complete. Our scripts are expected to take a long time (30+ seconds).
    Based on our testing, the AD connector times out in 30 seconds, and the Domino connector times out in 20 seconds. You would get the below exception in your Java Connector Server log file:
    Dec 4, 2013 2:36:41 PM org.identityconnectors.framework.api.operations.ScriptOnConnectorApiOp runScriptOnConnector
    FINE: Exception:
    java.lang.RuntimeException: Timeout waiting for action, process was terminated
        at org.identityconnectors.domino.WinJni._executeWinCommand(Native Method)
        at org.identityconnectors.domino.WinJni.executeWinCommand(WinJni.java:31)
        at org.identityconnectors.domino.ScriptOnConnector.executeCmdScript(ScriptOnConnector.java:143)
        at org.identityconnectors.domino.ScriptOnConnector.runScriptOnConnector(ScriptOnConnector.java:88)
        at org.identityconnectors.domino.DominoConnector.runScriptOnConnector(DominoConnector.java:316)
    Is there any way to configure OIM so that it waits longer for the action script to complete. The real problem over here is that if 2 users are being provisioned to AD and/or Domino simultaneously (we use access policies to trigger provisioning rules), then the connector (Java or .NET) does NOT invoke the action script for the second user if the action script for the first user times out. It does however create AD/Domino resources for all applicable users. This in itself is a defect - but I need a workaround.
    Looking at some old Sun Identity Manager documentation (which became Oracle Waveset), it seems that the entire OIM concept of action scripts has its origins in Sun Identity Manager/Oracle Waveset. And these products did support the notion of timeouts. Have a look at :
    http://docs.oracle.com/cd/E19225-01/821-0092/bzbuc/index.html
    Does anyone familiar with Oracle OIM code know if custom timeouts are supported by AD and Domino connectors?
    Thanks
    Aspi Engineer

    Change the time for the below under 'Web Intelligence Processing Server'
    Idle Document Timeout (seconds):
    Idle Connection Timeout (minutes):
    If you still have problem then try changing the web.xml under the following war files,
    AdminTools
    PartnerPlatformService
    PerformanceManagement
    PlatformServices

  • I am trying to reinstall Flash CS4 professional as the action script is not working but now I am getting an error: 2 message when I use the original CD to try and reinstall

    I can't get the original disk to work on a reinstall.  I get the message
    AdobeColorCommonSetRGB
    Error:
    Error 2.
    I teach a class using this program on Macintosh computers running 10.9.5 and the action script is not working.  It will work on any program designed using the 10.8 but if you design any animation on 10.9.5 the action script will not work for the buttons

    You would have to manually delete the color profiles in question... Run the cleaner tool and see if it gets you started.
    http://www.adobe.com/support/contact/cscleanertool.html
    Mylenium

  • Error in phase of assigniment Action Script

    Hello Guys!
    I created the following action script named "sketch.as" :
    package
    import flash.display.Sprite;
    import flash.events.MouseEvent;
    import com.adobe.images.JPGEncoder;
    public class sketch extends Sprite {
    public function sketch():void {
    //this is your documentclass constructor
    stage.addEventListener(MouseEvent.MOUSE_MOVE, moveCursor);
    Mouse.hide();
    function moveCursor(event:MouseEvent):void
        pencil.x = event.stageX;
        pencil.y = event.stageY;
    var canvas_mc:MovieClip = new MovieClip()
    addChildAt(canvas_mc, 0);
    canvas_mc.swapDepths
    function sketch()
    canvas_mc.graphics.beginFill(0xFFFFFF);
    canvas_mc.graphics.drawRect(0, 0, 600, 500);
    canvas_mc.graphics.endFill();
    canvas_mc.addEventListener(MouseEvent.MOUSE_DOWN, startDrawing);
    canvas_mc.addEventListener(MouseEvent.MOUSE_UP, stopDrawing);
    canvas_mc.addEventListener(MouseEvent.MOUSE_MOVE, makeLine);
    function startDrawing(event:MouseEvent):void{
    canvas_mc.graphics.lineStyle(1, 0, 1);
    canvas_mc.graphics.moveTo(mouseX, mouseY);
    canvas_mc.addEventListener(MouseEvent.MOUSE_MOVE, makeLine);
    function stopDrawing(event:MouseEvent):void{
    canvas_mc.removeEventListener(MouseEvent.MOUSE_MOVE, makeLine);
    function makeLine(event:MouseEvent):void{
    canvas_mc.graphics.lineTo(mouseX, mouseY);
    sketch();
    var serverPath:String = "";
    function createJPG(m:MovieClip, q:Number, fileName:String)
    var jpgSource:BitmapData = new BitmapData (m.width, m.height);
    jpgSource.draw(m);
    var jpgEncoder:JPGEncoder = new JPGEncoder(q);
    var jpgStream:ByteArray = jpgEncoder.encode(jpgSource);
    var header:URLRequestHeader = new URLRequestHeader ("Content-type", "application/octet-stream");
    var jpgURLRequest:URLRequest = new URLRequest ( serverPath+"jpg_encoder_download.php?name=" + fileName + ".jpg");
    jpgURLRequest.requestHeaders.push(header);
    jpgURLRequest.method = URLRequestMethod.POST;
    jpgURLRequest.data = jpgStream;
    var jpgURLLoader:URLLoader = new URLLoader();
    //jpgURLLoader.load(jpgURLRequest);
    navigateToURL(jpgURLRequest, "_blank");
    save_btn.addEventListener(MouseEvent.CLICK, saveBtnPress);
    save_btn.addEventListener(MouseEvent.ROLL_OVER, saveBtnOver);
    save_btn.addEventListener(MouseEvent.ROLL_OUT, saveBtnOut);
    function saveBtnPress(e:Event):void
    createJPG(canvas_mc, 90, "sketch");
    function saveBtnOver(e:Event):void
    Mouse.show();
    pencil.visible = false;
    function saveBtnOut(e:Event):void
    Mouse.hide();
    pencil.visible = true;
    Lately I created a file .fla in the same root of the file .as naming it "sketch.fla"
    When I try, in the Adobe Flash CS4 Professional screen, to assign to  ".fla" in the properties Publish my action script, the following message appears:
    “A definition for the document class could not be found in the classpath, so one will be automatically generated in tha SWF file upon export.”
    Obviously, it doesn’t function
    Could somebody help me??

    i don't understand, "When I try, in the Adobe Flash CS4 Professional screen, to assign to   ".fla" in the properties Publish my action script, the following message  appears:"
    but i do understand that error message.  you need to assign the document class for your fla.  in the properties panel with the backstage selected, assign sketch in the class or document class field.

Maybe you are looking for

  • Message no. FI313 - FM Issue

    Dear FM Experts, While posting Travelling Expense through HCM we are getting below Funds Management Error: No funds center entered/derived in item 00010 (HP01//) Message no. FI313 Diagnosis In company code (&2) the component Funds Management is activ

  • Very strange!! i got the old web?

    I have a very strange thing that happened and iam trying to figureout what is going on after i tried modifying tens or maybe hundreds of setting trying to solve it. I have a motorola sbg6580 for my home perimeter i have forwared port 80 to my webserv

  • User Defined Lists Setup Alternatives

    I have a rather large system project coming up.  One of the pillars of this system is to have the ability for users to create generic lists that can then be referenced by the UI and backend processes.  In order to data-drive this setup, I'm searching

  • Sun Java Web Proxy Server Routing to another Proxy Server

    hello every body i have installed Sun java web proxy server and we are get internet services from anotyher proxy server. how route SOCKS (Ports) to another proxy server) I mean 8080 web browsing is ok but my socks applicaiton like outlook is not work

  • SQL Developer 3.1 JDBC connect to Teradata fail

    I have the 3.1 release of Oracle SQL developer. I have the JDBC drivers for Teradata. I am tyring to get it to connect but it is failing. The error is very nondescript and of not much benefit. When I create the connection and put in the host name, us