help with buttons

Hello

IM do a shop in my game and I have a button saying my boat to change his image, but I get this error:

Scene 1, Layer 'have', frame 3, line 7 1061: call to a Stop method maybe not defined through a reference with static type class.

and here is the corresponding code:

Stop();
import flash.display.MovieClip;
import flash.events.MouseEvent;

Alien3.addEventListener (MouseEvent.MOUSE_DOWN, mouse1);
function mouse1(e:MouseEvent):void {}
Ship.gotoAndStop (2);
}

any help.

It seems that you have a class named 'Ship' and you try to say this class behaves as a movieclip in your code.  What you probably really want to do, this is something in addition to...

boat: boat of var = new Ship();

addChild (ship);

function mouse1(e:MouseEvent):void {}

ship.gotoAndStop (2);

}

Tags: Adobe Animate

Similar Questions

  • Need help with buttons of reminder - highlights

    Hi all

    I'm looking for help with Encoder CS5. I have a project works very well except that I have not made salient for the buttons, at least, I think it's what his name. So when the mouse or the remote control navigates to the up/down button toa it changes color.

    In the properties of my button, the highlight is dimmed.

    How can I request highlights?

    Thank you very much

    Chris Anderson

    Now its just the text.

    You define a prefix for the subpicture.

    http://help.Adobe.com/en_US/Encore/CS/using/WS2C3F3ABD-6457-4ca0-898F-720B7E3D0C10.html

  • Help with button code please?

    I am a novice and have completed my first animated film. I need help with action script.

    The film is currently in a loop and I created and invisible button the size of the frame with the intention that a user can click on the picture of the movie to stop it and the second click continue the film from where it stopped.

    I used AS event handler method to stop the sequence. I tested it and it works. But I can't understand the appropriate code to restart the movie.

    Two questions;

    1. I go to the task the right way? (should I use two buttons, a stop, a tenure)?

    2. If my approach is possible, can someone give me the right to re - start the movie and put me out of my misery please?

    You can use the following after having changed 'yourbutton' and 'yourmovieclip' to use appropriate instance names:

    {yourbutton.onRelease = function ()}

    {if(!this.) Toggle)}

    yourmovieclip. Stop();

    } else {}

    yourmovieclip. Play();

    }

    This.Toggle =! This.Toggle;

    }

  • Need help with buttons!

    Hello someone!

    The thing that I would need help with is the buttons that moves... Say there are 2 buttons on the stage, when someone clicks the button, the button from left to right movement and opens something when it stops there. So long it's fine for me, but now the peal problem.

    The thing is I want the button now on the right rear to place there where appropriate when I click on a button of the second (and it goes right to the place). When I do now the first button remains in place right... Do someone know what to type in Actionscript?

    Please help me... [email protected]

    what you use now which causes your keys for you move?

  • Help with buttons to access the loaded layers

    Hi all... Using Flash CS3 and AS3 to build a learning module that loads different layers of SWFs of the buttons on the main screen.  Got this work without problems.  What I want to do is to add buttons to provide learners of features, specifically a next button, the "back" button and a check box that will keep progress automatically.  I did some massive research and so far nothing seems to work.  Seems like I am going so far is the main layer, not the new layers as they are loaded.  Here is what I tried with the back button; the next button uses nextFrame and Handler2.  It does not work.  Not even sure how to start with the check box for advance auto.  Any help would be GREATLY appreciated.

    Mark

    back_btn.addEventListener (MouseEvent.MOUSE_DOWN, mouseDownHandler1);

    function mouseDownHandler1(event:MouseEvent):void

    {

    MovieClip (root) .prevFrame ();

    }

    If you try to get the swf loaded in advance and not the main timeline, you need to target the loader.content, not the root, as in:

    MovieClip (loader.content) .nextFrame ();

  • Help with button over the button (OnHover questions)

    I have a sat button A button B.  B button navigates to another point on timeline onmouseOut. A re acts as the B button onhover when hung on even though its only function is to go to a Web site when you click the button.  How to not to do so.  (it has something to do with the key a session over the B button that acts as a navigation panel.

    To illustrate, I have a circle (a ring) nagiavtion menu which is hover button B animtes, which actually look like the commuter ring to the Viewer.  When they mouse over button B he then times the next section of the scenario that seems to do the menu tilt back to normal.  So currently it is supposed to work like this:

    They hover over button B that comes alive to sign 10.  On board 10 the tilted wheel now has buttons of towing.  one to read a video and the other to go to the site for the link they flew over.

    When a person is placed on one of the buttons the tilting animation replays and retitls the wheels before the link becomes active to click which makes navigation uptight or bugged.  IWant the animation to play the 10 Panel and stay here, then they choose a button to click and only tilt back to normal when the user mouseout/mouseouthandler() the big underlying under button.

    Legitly evolves from the development of the object from one display to the other. Flash is required to send the MOUSE_OUT event as soon as your mouse cursor enters a new object because it is more on the previous object. This does not mean that you however he can only prevent.

    This is a pretty easy thing to manage with the code, but I need to know more about how to configure the button.

    Is the circle rotating a clip or a button? If it is a button that will take more work. If you have coded a MovieClip, then it will be easier.

    After that I know the answers to the above question, that the answer will result by setting just a few flags to know a condition. Once you have lost your drive in place and pop buttons on the screen, the MOUSE_OUT code will need to check that if you rode on all objects you do not want the drive to respond to the. I'll provide more code once you let me know how put you up.

  • Need help with button and motion tween...

    I am trying to create a simple game. For now, I have a button which, when you click top moves the character on the screen. My question is doing the Player stop looping when I click on the button. If I insert just for the last image, it will make a loop only once and stop, but he won't play again after that the button is clicked. I tried to use players_turn Boolean but could not get that to work. Any help will be appreciated. Thank you!

    [AS]
    package
    {
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    import flash.events.KeyboardEvent;
    import flash.ui.Keyboard;
    import flash.events.Event;
    import flash.ui.Mouse;

    SerializableAttribute public class Main extends MovieClip
    {
    Variables of player
    var players_turn:Boolean = true;

    Variables of the enemy

    public void Main()
    {
    Add event listeners
    buttonAttack.addEventListener (MouseEvent.CLICK, onButtonAttackClick);

    }

    Event handlers
    function onButtonAttackClick(event:MouseEvent):void
    {
    If (players_turn is true)
    {
    Enemy attack player
    player.gotoAndStop (2);
    trace ("Attack");
    trace (players_turn);
    }
    }
    trace (players_turn);
    / * If (players_turn == false)
    {
    Player.Stop ();
    players_turn = true;
    }*/

    }
    }
    [/ ACE]

    Looks rather than having stop(); in the last image, you must have...  MovieClip (parent) .gotoAndStop (1);

  • Help with button

    Real simple... I can make the background any color I want, but how to make it transparent?

    Yes, I am new Director and uses D11 on a PC.

    The button that I use is a basic button and I don't want to create in an external editor. Is it possible to make it transparent or I have to create an outwardly there have be transparent? I use several buttons to start different films according to the lesson is chosen. I have a graph I use as a comprehensive background and I want the interference of buttons with this background to be minimal but still be visible.

    I'm new Director as well, but I think that all you have to do is 1) select button 2) in the Sprite tab 3) according to the ink, select Inspector: select Transparent background from the drop-down list.

  • Help with button for search data & put in form fields

    I thought clicking on a button to fill out a few fields of the form with the data of a previous record would be simple, but there is something it clutter. I created 3 components are:

    1. a button "Copy last Pickup & drop-off Instructions" in my form box. It sets the button ask the value of 'COPY_PICKUP_DROPOFF '.

    2. a conditional branch, which sets fire ' on submit after treatment "conditional on the button, which branches off to the same page, and affects the application of 'COPY_PICKUP_DROPOFF '.

    3. a process (On Load - after header) Page that defines the shape of field values, that is subordinated to the request = COPY_PICKUP_DROPOFF (Type of Condition: Request = 1 Expression). Finally, it queries the database, but now the PL/SQL to define the shape of the field values is very basic:

    Start
    : P71_PICKUP_INSTRUCTIONS: = "debug set PICKUP INSTRUCTIONS."
    : P71_DROPOFF_INSTRUCTIONS: = "debug set DROP-OFF INSTRUCTIONS."
    end;

    Can anyone spot what I am missing which is required for this configuration to work? In that time by pressing the button submits the page but not to fill the form fields, do not raise errors.

    Hi Mark,
    I do not see the code for this link, so can't do any real investigation myself.
    In debug mode, when you click on 'Copy last Pickup and drop-off Instructions', you see that the application is actually the value?
    What is the source of the items you want to refresh? Populated each time or only when it is null?
    Cheers, Rob

  • need help with buttons and clips of discoloration

    Howdy,

    I have 3 buttons on a stage playing 3 different movies. Even if no button is pressed, there is a video loop during playback of the scene. When a key is pressed, a loop of film has melted and melted in the film this button asks. I have attached the script but it doesn't work at all. Don't know where to go from here.
    Thanks for your help.

    :

  • Help with buttons for the slideshow

    I'm working on my first flash project.  I created a simple slideshow image 4.  I have created 4 buttons that when clicked, jump to this image in the panel mounting.  I added rollover States for the button. Everything works as I want it.

    My question is how can I get the buttons to have a different look when this particular image is active?

    For example.  When the slideshow is on the 2nd picture, I want 2 button to have an active state (different look as the other three buttons).

    Here's my project file.

    Thank you

    You must use the movieclip buttons.

  • Help with buttons in AS3

    OK, so I tried different tutorials for a gallery of photos all day and nothing works. I have everything copied exactly, and they still do not work.

    http://Tuts.flashmint.com/how-to-create-a-simple-image-gallery-in-Flash-CS4/

    This is the tutorial I'm trying right now. When I get to step 5 in it, the Actioscript always comes up with errors.

    Now every tutorial I tried today always come with the same mistakes. I use AS3 in the Panel actions, but for some reason when I try to check the code he always tells me its wrong.vI even downloaded tutorials that give you the FLA and I made sure everything was the same, and corresponds to our code, but mine will give me errors.

    The errors I get are:

    Line 3: description: ' {' planned / source: function play1(event:MouseEvent):void {}}

    {Line 5: description: unexpected '}' encountered / source :}

    I'm ready to pull my hair!

    Here is the ActionScript code that I use:

    Stop();
    Btn1.addEventListener (MouseEvent.Click, play1);
    function play1(event:MouseEvent):void {}
    Stop ('Youth')
    }
    btn2.addEventListener (MouseEvent.Click, play2);
    function play2(event:MouseEvent):void {}
    Stop ('thoughtful')
    }
    btn3.addEventListener (MouseEvent.Click, play3);
    function play3(event:MouseEvent):void {}
    Stop ("dance")
    }
    btn4.addEventListener (MouseEvent.Click, PLAY4);
    function play4(event:MouseEvent):void {}
    Stop ('old')
    }

    Don't know what else you need to know, but if you need anything else, please let me know and I will let you know.

    Thank you very much!!!

    Jen

    There is nothing wrong with the code that you show.  You can check your publishing settings to make sure you're ready upi for the version of code you are trying to use (AS3).

  • Help with button to set the current page as home page

    Hey guys,.

    OK, I'm sure it's probably a really easy question because I know that I saw somewhere how to do, but I want to have two links on my home page that says something like: do "" my page and bookmark this page. Does anyone know how I would do it so that when they clicked on the buttons it just that? Thank you very much

    Jeremy

    Sunday, November 26, 2006, 09:28 + 0000 (UTC), "dayencom".
    wrote:

    > Hey guys,.
    >
    > Ok, I'm sure it's probably a really easy question because I know I have seen
    > somewhere how to do it, but I want to have two links on my home page that say
    > something like: do "" my page and bookmark this page. Does anyone know how I
    > would do that so that when they clicked on the buttons, it comes that? Thank you
    > much

    I get what you mean?

    http://JavaScript.Internet.com/miscellaneous/bookmark-page.html
    --
    Steve
    Steve at flyingtigerwebdesign dot com

  • help with framework button

    I have create a button (b1) can I double clicked and to "over" frame change color, so whene I'm above this button, I saw the color where I choose to "over" frame.

    I also have a (b2) button more and I want when I clicked on that the b1 button go to the color of the frame 'more' up to what I called the b2.

    any help with this?

    Thank you antony

    If b1 and b2 are movieclips and you label their mounts up and clicked with what is obvious, you can use something like:

    B1.onRelease = function() {}

    B2.gotoAndStop ("up");

    this.gotoAndStop ("clicked");

    };

    B2.onRelease = function() {}

    B1.gotoAndStop ("up");

    this.gotoAndStop ("clicked");

    };

  • With the help of hitTestObject with buttons added in AS

    I would use hitTestObject with buttons spark I create dynamically in Actionscript. I'm confused about this, however. I was testing this code:


    < s:Group id = "MyGroup" >
    < local: id = "button1" x = "100" RectButton = "20" label = "Button1" fill = "0xff0000" / >
    < local: RectButton id = "button2" x = "105" y = "20" label = "Button2" fill = "0x00ffff" / >
    < / s:Group >

    And I had this in the full feature for my test application:
    trace ("button 1 button 2 placement test:"+ button1.hitTestObject (button2) ');

    It returns the value true.

    When I remove the MXML for two buttons and add them to my complete feature like this:
    var button1: RectButton = new RectButton();
    Button1.x = 100;
    Button1.y = 20;
    Button1.label = "Button1";
    Button1.fill = 0xff0000;
    myGroup.addElement (button1);

    var button2: RectButton = new RectButton();
    Button2.x = 105;
    Button2.y = 20;
    Button2.label = "Button2";
    Button2.fill = 0x00ffff;
    myGroup.addElement (button2);

    Then this line:
    trace ("button 1 button 2 placement test:"+ button1.hitTestObject (button2) ');
    Returns false!

    The RectButtonSkin is really simple. It's a SparkSkin with this in it:
    < s:Rect left = "0" right = "0" top = low "0" = "0" height = "1" width = "1" >
    < s:fill >
    < s:SolidColor id = "rectFill" color = "0xffffff" alpha = "0.3" / >
    < / s:fill >
    < / s:Rect >

    And the RectButton is a spark button with a fill attribute.

    Anyone has any ideas on this subject?

    Thank you!
    Anna

    You can call hitTestObject() too early.  Try to wait for the updateComplete on the group event, for example:

    http://ns.Adobe.com/MXML/2009.

    xmlns:s = "library://ns.adobe.com/flex/spark".

    creationComplete = "createElements ()" > "

    Import spark.components.Button;

    Import mx.events.FlexEvent;

    private var asButton1:Button;

    private var asButton2:Button;

    protected function createElements (): void

    {

    asButton1 = new Button();

    asButton1.label = "Button1";

    asButton1.x = 100;

    asButton1.y = 20;

    myGroup.addElement (asButton1);

    asButton2 = new Button();

    asButton2.label = "Button2";

    asButton2.x = 105;

    asButton2.y = 20;

    myGroup.addElement (asButton2);

    too early

    trace (asButton1.hitTestObject (asButton2));

    wait updateComplete trace test

    myGroup.addEventListener (FlexEvent.UPDATE_COMPLETE, traceTest);

    }

    private void traceTest(e:Event):void {}

    trace (asButton1.hitTestObject (asButton2));

    }

    ]]>

Maybe you are looking for