Movie Clips as buttons – ignoring my stop actions and event listeners

Ok, so I think I am hear with the proper linked files to show you guys! Pretty much learning everything, so forgive my ignorance thus far!
Anyway, I am just trying to figure out movie clips as buttons, and have been following along on Lynda.com – however, I seem to be doing these things right, but when i test my movie, the button just loops regardless of rollovers or stop actions.
You can check this address www.midnyc.com to see the failed anim, and you should be able to import it as well. Here is my coding:
function rollover (e:EVENT){
    myBtn.gotoAndPlay ("in");
myBtn.addEventListener (MouseEvent.MOUSE_OVER, rollover);
function rollout (e:EVENT){
    myBtn.gotoAndPlay ("out");
myBtn.addEventListener (MouseEvent.MOUSE_OUT, rollout);
thank you in advance for your help. And to KGLAD, thanks for recommending how to post a bit better! Since I never had links etc... sorry about that.

Do you get any kind of error messages?  Normally if there's a coding error, movieclips and other things go haywire.
For you event handler functions, try specifying the event that matches the listener event...
function rollout (e:MouseEvent){
I think "EVENT" would be wrong anyways... "Event" would be correct

Similar Messages

  • Movie clips as buttons

    Hi all having a bit of difficulty with a project,
    Iam using movie clips as buttons, the only function they
    perform is loading in external swf files into a blank movie clip.
    The script I have used for this is as follows:
    on (release) {
    loadMovie("folio.swf", "_level0.holder");

    Hi joakimpilo, im not to sure im following your question
    correctly but here goes...
    I am assuming b1, b2, b3 and b4 are your MC buttons and you
    want these to load in information.
    This is what I do for similar situations,
    on your main timeline have an MC named holder that you will
    load external swf files into when you click a certain button. It is
    important that you take a note of the size so you can create the
    external swf at the same size, so when they load in they fit
    correctly.
    then in the buttonMC have a top layer that contains a simple
    box that covers the entire area of the MC. this kind of acts as a
    hit area so if you have animated the MC for a roll over effect make
    sure the button covers the area you need. I then apply the script
    to this button as follows (still in the buttonMC, not on main
    timeline)
    on (release) {
    loadMovie("yourexternalmovie.swf", "_level0.holder");
    "yourexternalmovie.swf" is the name of the external movie
    holding the informatiion you want loaded in to the "holder" MC.
    This is created in an entirely different flash document. Make sure
    and remember the name of these external files and just apply to
    each button.
    It is also very important to keep all the swf files in the
    same folder as the main flash file so it can see them to import.
    Hope that makes some sort of sense, and is actually what your
    looking for.

  • Struts Actions and events in one jsp?!

    Hello,
    I have a problem with Struts actions and events in a jsp.
    It is a search page and when the user clicks the search button I trigger an event and when the user clicks on a link in the result table (same page) I use an action that opens a new detail jsp. The first search query works well, I get a result, open the detail page, go back (using an action).
    Then I start a new search, but struts tries to open the detail page. While debugging I found out, that struts apparantly has no action or event. Why does it work at first time?
    Any ideas?
    Thanks in advance
    Britta

    Thanks for answer,
    I work with actions AND events. I think that`s the problem. When I go back from detail page to search page I use a custom DataForwardAction class with the following method:
    public void onCancel(DataActionContext ctx)
    DCBindingContainer bc = ctx.getBindingContainer();
    HttpServletRequest request = ctx.getHttpServletRequest();
    WebUtils.setSession(request);
    String ziel = request.getParameter("ziel");
    JUCtrlActionBinding action = (JUCtrlActionBinding) bc.findCtrlBinding("Rollback");
    action.doIt();
    try
    ctx.setActionForward(ziel);
    catch (Exception e)
    ctx.setActionForward("liste_freig");
    Ziel has the correct value ("search") and I think the struts config is also correct:
    <action path="/material" type="view.actions.materialAction" className="oracle.adf.controller.struts.actions.DataActionMapping" parameter="/material.jsp" name="DataForm">
    <set-property property="modelReference" value="generalUIModel"/>
    <forward name="liste_freig" path="/liste_freig.do"/>
    <forward name="liste_angelegt" path="/liste_angelegt.do"/>
    <forward name="list_bewertet" path="/list_bewertet.do"/>
    <forward name="liste_abgelehnt" path="/liste_abgelehnt.do"/>
    <forward name="liste_onhold" path="/liste_onhold.do"/>
    <forward name="search" path="/search.do?action=search"/>
    </action>
    But when I get back from material page to search page (the first time it works). The location pathname is material.do not search.do When start a new search the material page opens, not, as desired, the search page with new results.
    Search Action:
    public class searchAction extends DataForwardAction
    public searchAction()
    protected void prepareModel(DataActionContext ctx) throws Exception
    HttpServletRequest request = ctx.getHttpServletRequest();
    DataActionMapping acmap = ctx.getActionMapping();
    DCBindingContainer bc = ctx.getBindingContainer();
    WebUtils.setSession(request);
    JUCtrlActionBinding action = (JUCtrlActionBinding) bc.findCtrlBinding("delSearchQuery");
    action.doIt();
    String sEvent=null;
    try
    sEvent=request.getParameter("event");
    catch (Exception e)
    sEvent=null;
    if (sEvent==null)
    if (request.getParameter("action") != null)
    if (request.getParameter("action").equals("material"))
    Number mat_no=new Number(request.getParameter("MaterialNumber"));
    Number userId=new Number(WebUtils.getUserId(request));
    bc = ctx.getBindingContainer();
    action = (JUCtrlActionBinding) bc.findCtrlBinding("prepareMaterial");
    ArrayList arrayList= new ArrayList();
    arrayList.add(0,mat_no);
    arrayList.add(1,userId);
    action.setParams(arrayList);
    action.doIt();
    ctx.setActionForward("material");
    if (request.getParameter("action").equals("material_datasheet"))
    ctx.setActionForward("material_datasheet");
    super.prepareModel(ctx);
    public void onSearch(DataActionContext ctx)
    DCBindingContainer bc = ctx.getBindingContainer();
    HttpServletRequest request = ctx.getHttpServletRequest();
    WebUtils.setSession(request);
    ctx.setActionForward("search");
    Struts config:
    <action path="/search" className="oracle.adf.controller.struts.actions.DataActionMapping" type="view.actions.searchAction" name="DataForm" parameter="/search.jsp">
    <set-property property="modelReference" value="searchUIModel"/>
    <forward name="search" path="/search.do?action=search"/>
    <forward name="material" path="/material.do?action=material"/>
    <forward name="material_datasheet" path="/material_datasheet.do?action=material_datasheet"/>
    </action>
    I think it`s a Struts bug. Or is there something I don`t see?

  • Warning: Action and Event are not compatible for LinktoAction type

    Hi,
       I get a warning message "Action and event are not compatible" for the action associated with the type LinkToAction. The Action method "ShowDetails" has the parameters wdEvent (default) and IWDNodeElement.
       Can anybody please suggest what causes this warning?
    Regards
    Sagar

    Sagar,
    Unfortunately, it is impossible to remove this warning completely. However, you may safely ignore it.
    What you can do is copy text of warning (or part of text), then click "Filter" icon on Tasks view in IDE and set filter to hide these warnings. I do this for annoying "UI element has no lable text"
    Valery Silaev
    SaM Solutions
    http://www.sam-solutions.net

  • Difference between action and event

    Hi
    while creating an action, we will find action & event handler.  What is the difference between Action and event.  If anyone provide with examples, it will be helpful for me.
    regards,
    vijaya.

    HI,
    In simple words we can put it as..IF you need any user interaction.. i.e. if your logic is based upon how user interact with your application then use Action..
    e.g. Buttons, dropdown UI elements...etc..
    Means actions are act between user and your application.
    But your application not only communicate with user.But also communicate with server too.
    so to communicate with server you need and Event
    Note. In Web Dynpro, events are called actions if they are sent from the client to the server.

  • Noob help: Triggering Movie Clips with Buttons

    Hi guys,
    I'm taking an intro Flash and Action Script class and for my final I need to create a portfolio project that contains 5 unique buttons that trigger 5 unique movie clips. I'm having a hard time with this. I've been able to trigger the 1st movie clip with the first button (although I can't stop it) but I can't trigger any ohter movies with any other buttons.
    Here's my code:
    stop();
    chuck1_btn.addEventListener(MouseEvent.CLICK, playMovie);
    function playMovie(event:MouseEvent):void
        spaceship_mc.play();
    chuck2_btn.addEventListener(MouseEvent.CLICK,playSaucers);
    function playSaucers(event:MouseEvent):void
        saucers_mc.play();
    Nothing happens when I click on chuck2_btn when I test the movie. I think I need to create a variable or class but I'm not sure. I'm a super noob with this stuff. Any thoughts? Thanks!
    Rick

    You should learn how to use the Help documentation to find answers like how to use the visible property.  For the code you showed earlier, here's what you can try in frame 1 to replace it.
    stop();
    spaceship_mc.visible = false;
    saucers_mc.visible = false;
    slideshow_mc.visible = false;
    chuck1_btn.addEventListener(MouseEvent.CLICK, playMovie);
    function playMovie(event:MouseEvent):void
         spaceship_mc.visible = true;
         saucers_mc.visible = false;
         slideshow_mc.visible = false;
        spaceship_mc.play();
    chuck2_btn.addEventListener(MouseEvent.CLICK,playSaucers);
    function playSaucers(event:MouseEvent):void
         spaceship_mc.visible = false;
         saucers_mc.visible = true;
         slideshow_mc.visible = false;
        saucers_mc.play();
    etc...
    It could be refined, like having a function that hides everything and using that every time before making the one you need to show visible.  You might find it necessary to include telling the movies to gotoAndStop(1) as well.
    That's about as generous as I'm going to get.  It's important that you learn things, and handing you a solution isn't going to help do that.

  • Movie Clip loading buttons require double clicking on the first attempt

    I have created a number of buttons that load move clips into
    an empty movie clip. The problem is that it takes several clicks to
    activate the first clip button then the buttons behave as they are
    supposed to and load properly. Is there a reason why the first time
    you must click several times to activate the button loading a movie
    clip?

    stop();
    unloadMovie(1);
    agatha_btn.onRelease = function() {
    nextFrame();
    loadMovieNum("agatha_full.swf", 1);
    anastasia_btn.onRelease = function() {
    nextFrame();
    loadMovieNum("anastasia_full.swf", 1);
    chiara_btn.onRelease = function() {
    nextFrame();
    loadMovieNum("chiara_full.swf", 1);
    clarisse_btn.onRelease = function() {
    nextFrame();
    loadMovieNum("clarisse_full.swf", 1);
    fifi_btn.onRelease = function() {
    nextFrame();
    loadMovieNum("fifi_full.swf", 1);
    gigi_btn.onRelease = function() {
    nextFrame();
    loadMovieNum("gigi_full.swf", 1);
    ginger_btn.onRelease = function() {
    nextFrame();
    loadMovieNum("ginger_full.swf", 1);
    ingrid_btn.onRelease = function() {
    nextFrame();
    loadMovieNum("ingrid_full.swf", 1);
    lucrezia_btn.onRelease = function() {
    nextFrame();
    loadMovieNum("lucrezia_full.swf", 1);
    natasha_btn.onRelease = function() {
    nextFrame();
    loadMovieNum("natasha_full.swf", 1);
    philipa_btn.onRelease = function() {
    nextFrame();
    loadMovieNum("philipa_full.swf", 1);
    signy_btn.onRelease = function() {
    nextFrame();
    loadMovieNum("signy_full.swf", 1);
    sophia_btn.onRelease = function() {
    nextFrame();
    loadMovieNum("sophia_full.swf", 1);
    teresa_btn.onRelease = function() {
    nextFrame();
    loadMovieNum("teresa_full.swf", 1);
    trudi_btn.onRelease = function() {
    nextFrame();
    loadMovieNum("trudi_full.swf", 1);
    };

  • How to change the movie clip a button links to???

    I am working on a website in Flash that had already been
    designed by someone else. There are a number of buttons across the
    website that are linked to the same symbol. Those buttons link to
    movie clips, in the button's actions, that pop up as small windows
    providing more information in regards to the button clicked. The
    problem is that I cannot figure out how to properly change the link
    association between button and movie clip.
    Here is the action script for one of the buttons:
    on (release) {
    _root.scrHEIGHT=100
    _root.scroller.scroller.gotoAndStop(2);
    _root.scroller._x = 100;
    _root.scroller._y = 150.7;
    _root.TM_title = "About Chris Smith";
    _root.READ = 3;
    When I change the number after "root.READ =" it will change
    it to another movie clip but I how do I know what that association
    is based on? For instance if I make a duplicate movie clip how can
    I make the above script link to it? Also, what exactly does that
    last line in the above script mean? When I tested various numbers,
    like 3 and 6, they would link to the same movie clip.
    Please help! This is driving me crazy!
    Thanks!!!

    Hi,
    buttons can be defined with static icon/text, or dynamically via a variable (containing @08\Qtooltip@text for example). You choose the pushbutton type when you define your button using the screen painter. For the dynamic definition, you must tick the "output only" checkbox, enter a global variable name, that you'll fill in your program, preferably using ICON_CREATE function module.
    BR
    Sandra

  • Using an array to assign movie clips to buttons

    Thanks in advance for any help you can give me!!
    I've got 5 movie clip buttons.  When a user rolls over a button, I want one movie clip to play. When a user clicks on that button, an alternate movie clip plays. I'm trying to use an array to assign certain movie clips to certain buttons and actions, but I'm not doing something quite right. I can get one button to work correctly, but then am having issues getting the other buttons to work.
    Here is the code I have:
    var currentPage:MovieClip;
    var currentScreen:MovieClip;
    var prevPage:MovieClip;
    var currentButton:MovieClip;
    var arrNavigation:Array = [{button:m1_mcButton, page:m1_mc, screen:s1_mc},
       {button:m2_mcButton, page:m2_mc, screen:s2_mc}]
    for(var i=0;i<arrNavigation.length;i++){
    arrNavigation[i].button.buttonMode=true;
    arrNavigation[i].button.addEventListener(MouseEvent.ROLL_OVER, onButtonOver);
    arrNavigation[i].button.addEventListener(MouseEvent.ROLL_OUT, onButtonOut);
    arrNavigation[i].button.addEventListener(MouseEvent.CLICK, onButtonClick);
    function onButtonOver(e:MouseEvent):void
    for(i=0;i<arrNavigation.length;i++) {
    if(arrNavigation[i].button == e.currentTarget)
    currentPage = arrNavigation[i].page;
    currentPage.gotoAndStop("over");
    function onButtonOut(e:MouseEvent):void{
    currentPage.gotoAndStop("out");
    function onButtonClick(e:MouseEvent):void{
    for(i=0;i<arrNavigation.length;i++) {
    if(arrNavigation[i].button == e.currentTarget)
    currentScreen = arrNavigation[i].screen;
    arrNavigation[i].screen.gotoAndPlay("over");

    if your buttons are movieclips, use:
    var currentPage:MovieClip;
    var currentScreen:MovieClip;
    var prevPage:MovieClip;
    var currentButton:MovieClip;
    var arrNavigation:Array = [{button:m1_mcButton, page:m1_mc, screen:s1_mc},
       {button:m2_mcButton, page:m2_mc, screen:s2_mc}]
    for(var i=0;i<arrNavigation.length;i++){
    arrNavigation[i].button.buttonMode=true;
    arrNavigation[i].button.addEventListener(MouseEvent.ROLL_OVER, onButtonOver);
    arrNavigation[i].button.addEventListener(MouseEvent.ROLL_OUT, onButtonOut);
    arrNavigation[i].button.addEventListener(MouseEvent.CLICK, onButtonClick);
    arrNavigation[i].button.ivar=i;
    function onButtonOver(e:MouseEvent):void
    currentPage = arrNavigation[e.currentTarget.ivar].page;
    currentPage.gotoAndStop("over");
    function onButtonOut(e:MouseEvent):void{
    currentPage.gotoAndStop("out");
    function onButtonClick(e:MouseEvent):void{
    currentScreen = arrNavigation[e.currentTarget.ivar].screen;
    currentScreen.gotoAndPlay("over");

  • Movie clip as button label

    Hi,
    I need to place a lot of buttons in the scene with different labels. I have created one button (not ui component). It is having custom look and feel. And I have placed many of the instances of this button in the scene.
    Now I need to add different labels two each button. These labels are not simply some texts, but movie clips.
    So how can I place these labels to each button? Placing an empty movie clip and calling attachMovie in action script failed...
    I am not sure how to achieve my requirement. If needed, I can give more explanation about the requirement.
    Thanks in advance.

    Thank you for the reply.
    But I am not sure how to add the movieclip holder (with which I call .attachMovie) to the button. If I add it the UP location of the button, I cannot access it. What I need to do is attach the movieclips in the Library (with Linkage ID specified) to each buttons from the scene using AS.
    Example:
    In action script,
    myBtn1.myLabel_mc.attachMovie( "myLabelClip1_ID", ........ );
    myBtn2.myLabel_mc.attachMovie( "myLabelClip2_ID", ........ );
    So could you please suggest me a little more better?

  • Attaching movie clips to buttons

    I would like to design a portfolio site in which I have small
    buttons that, when moused over, they display, a pic just above it.
    Each button triggers a different pic above it.

    The best way to go about doing is is to use the MovieClip
    class instead of the button class. Use the onRollover event. For
    example, have a movie clip that displays the image on the second
    frame. The use the actionscript: nameOfMovieClip.onRollover =
    function():Void {
    this.gotoAndStop(2);
    If you want to use the button class to accomplish the same
    task, then you will have to create an image that you want to
    display then under the "over" frame of the button, place the image.
    If you want the original image to be there and display the new
    image, then just add a new layer and put the image in the new layer
    while keeping to original layer.

  • Access Movie clip inside Button

    Is there a way to access a movie clip inside a buttion?
    I have a bunch of images in a movie clip, and I want to have the same mc to change frames in different button symbols. But when try to talk to it myButton.myMovieClip.gotoAndStop(3);
    It gives me and error.
    1119: Access of possibly undefined property myMovieClip through a reference with static type flash.display:SimpleButton.

    no.
    use a movieclip button.

  • Using movie clips as buttons

    I dont ever use buttons because movie clips appear to do all
    of the same stuff with the same code.
    so in my set up i have a "video" section that, when you "roll
    over" it expands and reveals some video thumbnails. i want it so
    when you click the video thumb that a page will open on the right
    side. i have all the "on release" code set up but it still wont
    work???? i think that the expanding window is all worried about
    waiting for the "roll out" to happen so the buttons cant be
    clicked.
    how do i have it so that the movie clip does its roll in roll
    out stuff but dosent change your courser into the little hand and
    finger like its a button?
    NOTE: the "korath" article has the same type of code as the
    thumbnails (except for the different target object)
    oh and should i be using "relative" or "absolute" for the
    target object???
    there is the example at
    www.wafflecone.ca
    i couldnt upload the full fla cuz its 15 MB!

    uhmmm well this is all getting a little confusing.
    i havent used this kind of code before and it hasent worked
    in the few places iv tried (I replaced the "movieclipname" text)
    the best way is too look at the fla....heres a link
    http://www.mediafire.com/?zlld2j0mxxj
    i know that the movie clips can be confusing, im still
    learning on how to set everything up.
    -double click on the "video" box on the left side
    -move the timeline to 20
    -"click the "video" box once
    that is where i have been putting most of the code.
    you can go further into the "video" box where there is more
    movie clips.
    masking
    than where the thumbnails are.
    hope you can take a look at it.

  • Movie clip draggable button

    Here is the code I have so far. it has been driving me nuts
    in my attempt to make my homepage the problem is it will not read
    the gotoAndPlay command to take the overall movie to frame 5 and
    then stop. seems easy and not overwelming but no matter what i do
    it does not work.
    here is the code please help.
    //about button commands
    var mcAbout:MovieClip;
    mcAbout.onPress = function(){
    startDrag("mcAbout");
    mcAbout.onRelease = function(){
    stopDrag();
    var mcAbout:MovieClip
    mcAbout.onRollOver = function(){
    mcAbout.gotoAndPlay("rollover");
    mcAbout.onRollOut = function(){
    mcAbout.gotoAndPlay("rollout");
    mcAbout.onMouseDown= function(){
    mcAbout.gotoAndPlay(5);
    }

    there, at least, two problems. first, there's a logic issue.
    if you want to start dragging your button with one click
    you'll need some way to stop dragging it and you can't use the
    onRelease handler because it may execute BEFORE the single click
    code executes.
    to understand this you must understand something about any
    and all techniques to detect and differentiate between a single and
    double click. by necessity, for a single click to be detected by a
    button that must check for a double click, some period of time must
    elapse before the button can conclude that it's been clicked once.
    it can't execute it's single click code during that time or it may
    execute that code and then find a 2nd click has arrived in time to
    qualify as a double click and you wouldn't want your button to
    execute its single and double click codes.
    therefore, if a user clicks and releases your button in
    normal rapid succession your button will execute its stopDrag()
    before its startDrag() resulting in your button being dragged.
    so, for a button that you want to sometimes drag and
    sometimes have execute other code, you should not use a single and
    double click technique. you should use one that detects a press and
    hold (startDrag) versus a press and release (execute single click
    code).
    and the second error, you misspelled mcAbout in clickF():

  • Changing depths of movie clips with button clicks

    Hello all,
    I've got a file on working on that has 4 different movie clips on one layer that, when clicked, will zoom in (made with tweens in the timeline).
    The issue I'm having, is that when I click one of them, they are arranged in a way that won't work for what I need. I click one, and it works, but it is hidden by the movie clip that is on top of it in the heirarchy. Click another, zooms in, but is partially hidden by another one.
    My question is: Is there anyway in AS2 to code these so that when one is clicked, it will the top spot in the heriarchy? So that I can code them all like this so that whenever one is clicked, it goes to the top so it is not hidden?
    Thanks

    Correct me if I'm wrong, but isn't that just used to swap 2 movie clips?
    Or is there a number I can input instead of the movie clip name that will change all of them?

Maybe you are looking for

  • Assigning a login module to a single WebDynpro to authenticate against LDAP

    Hi there, we are running the J2EE Engine 7.0 within XI on SAP NetWeaver 2004s / Linux x86_64. Basically, i want to Authenticate a Java WebDynpro against an LDAP (Active Directory). With the XI Usage installed, I can not customize the UME to authentic

  • How to create code in another Project's package

    In 11.5.10 jDeveloper 9.0.3 OA I've created a custom package in a project and put a VO into it. I've deployed that code to Oracle Applications. I now want to create new customizations within that same package but would like to do so in a new project.

  • Why won't "my apple id" allow me to delete one of my alternate email addresses?

    I have several alternate e-mail addresses the "My Apple ID" web page, a couple of which are outdated and I want to delete.  When I click on "delete", nevertheless, they still show up.  Any ideas?

  • Download to Excel with Header but one field data is repeating

    Hi All, I'm downloading to Excel with Header. But One field is repeating and another is not. This is happening only when I use   'CONCATENATE ' . With Out this key usage data download to excel is correct. But   CONCATENATE is required as constant nee

  • GREP for changing a character

    Hi people, I have many lists like a) local, b) de ZEC y c) de Región Biogeográfica d) Escala local, o de estación how can I change the a and the bracket of this list to Italic with GREP. Can i select just a paragraph like Paragraph Style to apply GRE