Simple button function issue

Why won't this work?
meta_nav.bm0.onRollOver = function () {
meta_nav.bm0.gotoAndStop("state2");
I've double checked to be sure all instance names and frame
labels are correct. And have tested the same function with bm0 on
the _root level, and this works fine:
bm0.onRollOver = function () {
bm0.gotoAndStop("state2");
What am I missing to call a function to an MC nested within
another MC?
I've also tried this:
_root.meta_nav.bm0.onRollOver = function () {
_root.meta_nav.bm0.gotoAndStop("state2");
And this:
_root.meta_nav.bm0.onRollOver = function () {
myNodeButton = _root["meta_nav.bm0"];
myNodeButton.gotoAndStop("state2");
No luck.

Hey Michael, you're very close the solution yourself. Instead
of trying to addressing scope in a absolute fashion (_root), try
the relative approach.
When you nested this videoclip, _root does not point to this
movieclips timeline anymore, but to the root of the movieclip it is
nested in. See it as that you added a ground level story to your
house, lifting the old house, and see the front door as something
on root level. In this case, you do not want to take the stairs
down, but remain on the first etage.
this.meta_nav.bm0.onRollOver = function () {
this.gotoAndStop("state2");
try tracing some this-es to find out what scope your current
function has.

Similar Messages

  • Simple button function

    New to Flash: I have a simple two frame doc. I want the movie
    to stop at the first frame, wait until the button "jackets_btn" is
    clicked, then go to second frame and stop. This is the code I wrote
    which doesn't stop at first frame:
    stop();
    function jackets(event:MouseEvent) :void
    gotoAndStop(2)
    jackets_btn.addEventListener(MouseEvent.CLICK, jackets);
    Thanks for any insight
    Gretchen

    if that code is on the first frame of your main timeline it
    should work without problem.

  • Can someone help me with a somewhat simple button function?

    I am working on a project and a small part of that project is creating a counter increases by one everytime a button is clicked. For example I have incuded a picture of a much simpler version of what I am doing. For some reason I can not get the code right so that every time you click the grey rectangle the text increases to one and then two and so on.

    Get this code in your composition
    In Compostion ready event :
    sym.setVariable("counter",0);
    In the click event of the Rectangle have this code :
    var counter = sym.getVariable("counter");
    counter++;
    sym.setVariable("counter",counter);
    sym.$("Text").html(counter);
    In the above snippets the text field is reset to 0 whenever you refresh or reopen the page.
    Hope this helps you

  • Simple button not functioning?

    I've been staring at this code for an hour. Maybe I need a break? This is a very simple button that just won't accept my touch events.
    I have a movie clip. It's instance name is "boardA." The name of the symbol is "letterA" and it is linked to a class file called "Letters" (which is properly linked, I checked).
    This is the code in the class file:
    public function Letters() {
                this.addEventListener(TouchEvent.TOUCH_BEGIN, createLetter);
                trace (this.letter);
            public function createLetter(e:TouchEvent): void {
                trace ("You clicked it!");
                trace ("eName = " + e.target.letter);
    Yet nothing happens when I click the button. The constructor for the file never executes.
    I even moved the touch event to the main frame "boardA.addEventListener(TouchEvent.TOUCH_BEGIN, createLetter)" and it still didn't work. Nothing when I touch the button.
    What am I missing here?
    Thanks
    Amber

    No. Letters.as is in com/freerangeeggheads/spellmaster. It's linked as such - here is the text.
    The base class is: com.freerangeeggheads.spellwhiz.Letters
    The class is: letterA
    When I click the green check box it tell me it can find the class, and when I click the edit class button it takes me to the proper script file.
    I also have the file imported into my main frame.
    This is the Letters.as file:
    package  com.freerangeeggheads.spellwhiz {
        import flash.display.*;
        import flash.events.*;
        import com.freerangeeggheads.spellwhiz.*;
        public class Letters extends MovieClip {
            public var letter:String = "";
            public function Letters(): void {
                this.addEventListener(TouchEvent.TOUCH_BEGIN, createLetter);
                trace (this.letter);
            public function createLetter(e:TouchEvent): void {
                trace ("You clicked it!");
                trace ("eName = " + e.target.letter);
    Thanks!

  • Simple Button not functioning correctly?

    The button functions correctly, but for some reason when I launch the flash page, the button shows up with the alpha at 50%. I narrowed it down to the    var elasticTween3:Tween = new Tween(my_box,"alpha",Strong.easeOut, 0.5, 1, 1, true);  line of code, but I need that line to fade the alpha from 50% to 100% when mouse out occurs. Am I missing something??
    Below is my code:
    import fl.transitions.Tween;
    import fl.transitions.easing.*;
    import fl.transitions.TweenEvent;
    import flash.events.MouseEvent;
    var myTween:Tween = new Tween(my_box, "alpha", Strong.easeOut, 1, 0.5, 1, true);
    myTween.stop();
    var elasticTween1:Tween = new Tween(my_box, "x", Elastic.easeOut, 35, 45, 1.5, true);
    var elasticTween2:Tween = new Tween(my_box, "x", Elastic.easeOut, 45, 35, 1.5, true);
    elasticTween1.stop();
    elasticTween2.stop();
    my_btn.addEventListener(MouseEvent.MOUSE_OVER,hover);
    function hover(e:MouseEvent){
    myTween.start();
    elasticTween1.start();
    elasticTween2.start();
    var elasticTween3:Tween = new Tween(my_box,"alpha",Strong.easeOut, 0.5, 1, 1, true);
    elasticTween3.stop();
    my_btn.addEventListener(MouseEvent.MOUSE_OUT,out);
    function out(e:MouseEvent){
    elasticTween3.start();
    elasticTween1.start();
    elasticTween2.start();

    make sure that code executes exactly once.  ie, that frame shouldn't be re-entered.  use the trace() function to confirm, if you think you've prevented re-entry.
    import fl.transitions.Tween;
    import fl.transitions.easing.*;
    import fl.transitions.TweenEvent;
    import flash.events.MouseEvent;
    var myTween:Tween = new Tween(my_box, "alpha", Strong.easeOut, 1, 0.5, 1, true);
    myTween.stop();
    var elasticTween1:Tween = new Tween(my_box, "x", Elastic.easeOut, 35, 45, 1.5, true);
    var elasticTween2:Tween = new Tween(my_box, "x", Elastic.easeOut, 45, 35, 1.5, true);
    elasticTween1.stop();
    elasticTween2.stop();
    my_btn.addEventListener(MouseEvent.MOUSE_OVER,hover);
    function hover(e:MouseEvent){
    myTween.start();
    elasticTween1.start();
    elasticTween2.start();
    var elasticTween3:Tween = new Tween(my_box,"alpha",Strong.easeOut, 0.5, 1, 1, true);
    elasticTween3.stop();
    my_btn.addEventListener(MouseEvent.MOUSE_OUT,out);
    function out(e:MouseEvent){
    elasticTween3.start();
    elasticTween1.start();
    elasticTween2.start();

  • Override "Email a Page link" in ribbon button functionality in SharePoint 2013

    Hi,
    I want to override "Email a Page link" ribbon button functionality on the ribbon control.
      <CustomAction Id="Ribbon.WikiPageTab.Share.EmailPageLink"
                    Location="CommandUI.Ribbon"                
                    Title="Custom Email this page">
        <CommandUIExtension>
          <CommandUIDefinitions>
            <CommandUIDefinition Location="Ribbon.WikiPageTab.Share.EmailPageLink">
              <Group
              Id="Ribbon.WikiPageTab.Share"
              Sequence="30"
              Command="ShareGroup"
              Description=""
              Title="$Resources:core,cui_GrpShare;"
              Image32by32Popup="/_layouts/15/$Resources:core,Language;/images/formatmap32x32.png?rev=23" Image32by32PopupTop="-137" Image32by32PopupLeft="-103"
              Template="Ribbon.Templates.Flexible2"
              >
                <Controls Id="Ribbon.WikiPageTab.Share.Controls">
                  <Button
                    Id="Ribbon.WikiPageTab.Share.EmailPageLink"
                    Sequence="10"
                    Command="CustomEmailPageUrl"
                    Image16by16="/_layouts/15/$Resources:core,Language;/images/formatmap16x16.png?rev=23" Image16by16Top="-115" Image16by16Left="-19"
                    Image32by32="/_layouts/15/$Resources:core,Language;/images/formatmap32x32.png?rev=23" Image32by32Top="-137" Image32by32Left="-511"
                    LabelText="$Resources:core,cui_ButEmailLink;"
                    ToolTipTitle="$Resources:core,cui_ButEmailLink;"
                    ToolTipDescription="$Resources:core,cui_STT_ButEmailLinkPage;"
                    TemplateAlias="o1"
                   />
                </Controls>
                  </Group>
            </CommandUIDefinition>
          </CommandUIDefinitions>
          <CommandUIHandlers>
            <CommandUIHandler Command="CustomEmailPageUrl" CommandAction="javascript:alert('Hello, world');" />
          </CommandUIHandlers>
        </CommandUIExtension>
      </CustomAction>
    Any help would be appreciated.
    Rajasekar A.C

    Hi,
    According to your post, my understanding is that you wanted to override the “E-mail a Link” button on the Ribbon.
    I had created a simple demo to override the “E-mail a Link” button on the Ribbon, you can have a look at it.
    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <CustomAction Id="Ribbon.Library.Actions.OverrideEmailLinkButton" Location="CommandUI.Ribbon" RegistrationId="101" RegistrationType="List" Title="Display the UniqueId for the list item.">
    <CommandUIExtension>
    <CommandUIDefinitions>
    <CommandUIDefinition Location="Ribbon.Library.Share.EmailLibraryLink">
    <Button Id="Ribbon.Library.Share.EmailLibraryLink.ReplacementButton" Command="ReplacementButtonCommand" Image16by16="http://s10.postimage.org/lhar0oijp/U16.png" Image32by32="http://s17.postimage.org/trf3y2ui3/U32.png" LabelText="Replaced Button" TemplateAlias="o2" />
    </CommandUIDefinition>
    </CommandUIDefinitions>
    <CommandUIHandlers>
    <CommandUIHandler Command="ReplacementButtonCommand" CommandAction="javascript:alert('This button has been replaced.');" />
    </CommandUIHandlers>
    </CommandUIExtension>
    </CustomAction>
    </Elements>
    More reference:http://msdn.microsoft.com/en-us/library/office/ff407619(v=office.14).aspx
    Thanks,
    Jason
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Jason Guo
    TechNet Community Support

  • Simple button script not working

    I am using AS2 and need help figuring out why this simple button script is not working:
    stop();
    buttonWS1.onRelease = function(){
                        gotoAndStop("Stage1and2_Boss",4);
    buttonWS2.onRelease = function(){
                        nextFrame();
    //end
    My buttons are the square letter-puzzles below. They are images that I converted to "symbols" (specifically, buttons). I put their names as above (buttonWS1, buttonWS2, etc.) in the "instance names" boxes.
    I have no idea what is going on. Please help!

    Hi -
    1. Yes, buttonWS2 is the instance name
    2. The only code attached to it is the code I pasted above.
    3. onRelease does not execute because my trace statement does not appear in the output
    Here is the modified code for buttonWS2:
    buttonWS2.onRelease = function(){
                        trace("clicked!");
                        nextFrame();
    Question: It shouldn't matter if I have commented-out code within that set of codes should it?:
    buttonWS2.onRelease = function(){
              //if (puzzleschosenarray[0] == 2 || puzzleschosenarray[1] == 2) {
              // cannot be chosen -- make button non-functional
              //else{
                        //puzzleschosenarray[roundnumber-1] = 2;
                        trace("clicked!");
                        nextFrame();

  • Simple button in AS3

    hello everybody,
    in my website I have a simple button that should trigger at
    every click a different frame. Browsing the net I have found the AS
    for the simple button (attached code) that works for a sigle click.
    Would please tell me the AS to give to the button the
    function described above??
    thank you so much

    My line would replace the gotoAndStop(2) that you had in your
    previous code. But I'm not sure that it is what you want. The code
    I gave you will tell the thing you clicked on to go to frame 2 and
    only to frame two.
    I think you are trying to do something different that what I
    thought. I think what you want instead of your gotoAndStop() line
    you just want
    nextFrame();
    Of course you might want to do something special when you get
    to the last frame so you might want to add something like:
    if(currentFrame==totalFrames){
    next.removeEventListener(MouseEvent.CLICK, release);
    next.alpha=.5;
    That would go just after the nextFrame(). That checks to see
    if the current frame is the last one and if so removes the click
    handler from the next button and makes it transparent so it looks
    disabled. (That could be done in a lot of fancier ways, but this
    was just to give you the idea.)
    Does that help?

  • Cross-Browser (BASIC Functionality) Issue - Need to boot to Windows in parallels to use the websites I need - PLEASE HELP!

    Hey Everyone,
    Let me lead with my system specs. If you need more info, please let me know and I'll be happy to supply them. I'll be sitting by my computer all night, glaring at my Snow Leopard Install Discs and hoping that you guys don't say that the only thing left to do is a clean install of SL, then re-upgrade to lion.
    So, a few months ago, I noticed that certain components on websites wouldn't work. They would be pretty basic - simple buttons at first. Then certain submission forms wouldn't process. Then, recently, there has been a complete loss of video playback on certain websites. And the final straw, the Vuze software update button will not click through.
    In order to work around these browser break downs, I've had to launch Linux/Windows 7 or 8 (depending on wether or not I wanted to make myself even MORE frustrated by using metro) to do my web browsing.
    Here are a few examples. Again - ALL these websites work in other operating systems.
    Groupon - via http://www.groupon.com/subscriptions/new?division_p=philadelphia
    The "Continue" button does not function. It will depress on click, and highlights on mouseover, but it will not lead to the next page.
    A Picture is Below.
    Math Warehouse - via http://www.mathwarehouse.com/quadratic/quadratic-formula-calculator.php
    This site houses a calculator for the quadratic formula and other nerd tools - but essentially, just a standard forms with fields. Clicking the "Solve the Quadratic Equation" button does not work. In fact, in this case, mousing over causes the pointer to turn into a text curser.
    Picture below.
    Vuze - Internal App
    Clicking this button does nothing. Nothing at all.
    I've posted a similar thread when this first happened, where I included activity monitor and consol logs, but no one could make heads or tales of them. one guy even said there was nothing wrong.
    i know steve jobs said that macs were the best hardware around for running windows. I don't think that this is what he meant.
    Any and all help, is really, really appreciated.
    Thank you,
    Bernie

    Hey Everyone,
    Let me lead with my system specs. If you need more info, please let me know and I'll be happy to supply them. I'll be sitting by my computer all night, glaring at my Snow Leopard Install Discs and hoping that you guys don't say that the only thing left to do is a clean install of SL, then re-upgrade to lion.
    So, a few months ago, I noticed that certain components on websites wouldn't work. They would be pretty basic - simple buttons at first. Then certain submission forms wouldn't process. Then, recently, there has been a complete loss of video playback on certain websites. And the final straw, the Vuze software update button will not click through.
    In order to work around these browser break downs, I've had to launch Linux/Windows 7 or 8 (depending on wether or not I wanted to make myself even MORE frustrated by using metro) to do my web browsing.
    Here are a few examples. Again - ALL these websites work in other operating systems.
    Groupon - via http://www.groupon.com/subscriptions/new?division_p=philadelphia
    The "Continue" button does not function. It will depress on click, and highlights on mouseover, but it will not lead to the next page.
    A Picture is Below.
    Math Warehouse - via http://www.mathwarehouse.com/quadratic/quadratic-formula-calculator.php
    This site houses a calculator for the quadratic formula and other nerd tools - but essentially, just a standard forms with fields. Clicking the "Solve the Quadratic Equation" button does not work. In fact, in this case, mousing over causes the pointer to turn into a text curser.
    Picture below.
    Vuze - Internal App
    Clicking this button does nothing. Nothing at all.
    I've posted a similar thread when this first happened, where I included activity monitor and consol logs, but no one could make heads or tales of them. one guy even said there was nothing wrong.
    i know steve jobs said that macs were the best hardware around for running windows. I don't think that this is what he meant.
    Any and all help, is really, really appreciated.
    Thank you,
    Bernie

  • Can't get Simple button to Load Movie Clip

    Hi I've looked around for the answer to my question on this
    forum
    but havent found it so here it goes. I am working on this
    company's
    Flash site that was built by an outside studio. I am using
    CS3.
    The url to the site is
    http://www.bubbakeg.com.
    (this link will take you to the main page click the shadow
    graphic
    on the left under Bubba and this will take you to the site I
    am speaking
    of. The site is basically 5 different pages or movie clip.
    What I am
    trying to do is basically change the "Spring Break" middle
    graphic
    (which is a Movie Clip) on the HOME page and add a simple
    button
    that will direct the user to a new page. When I replaced the
    graphic
    with a new Movie clip there was no problem but I have added
    a
    button to load a new page (movie clip) and nothing happens.
    This
    button is in the movie clip of the new graphic which is
    called up
    when the page loads. If i take this button and just put it
    on the
    Main Stage in Scene 1 by itself it works and loads the page
    (movie clip). It does not however when it is embeded in the
    Movie
    Clip. The Flash site is basically 5 different Movie Clips
    loaded into
    an "Empty Clip". This empty clip has a timeline with each of
    the
    clips labeled and with their respective sized placeholders.
    And
    when you click on either the links on the Nav bar or the
    graphic
    for each page it loads that movie clip on the main page. It
    seems
    like the button only wants to work on the main timeline. I
    have
    even replaced the code for the "Contact" button with the code
    for the new button and it worked (opening new page). Here is
    the
    code for the new button that does not work:
    on (release) {
    _root.contentHolder.myHeight = 307;
    _root.contentHolder.newLoc = 9;
    heightAnimation();
    I know the location and height from the above code are
    referring to the placement and sizing of each movie clip
    in the "Empty Clip". As i said before this heightAnimation
    and the resizing of the new clip works fine when the
    button resides in Scene 1 on the Main Timeline but not
    within the new movie clip (graphic Ive created.)
    I will upload the main chunk of the code that resides
    in Scene 1 on the first frame of the "Actions" layer.
    If anyone has any ideas I would appreciate it very much!
    Please let me know if I can provide anymore info.
    Thanks!
    Greg

    change:
    function newLayerBT_CLICK(MouseEvent):void{
    to:
    function newLayerBT_CLICK(e:MouseEvent):void{

  • Button Function Failure on Adobe Content Viewer

    Why do the button functions work well the first time I view them on my iPad's Adobe Content Viewer but do not function properly in subsequent viewings?
    For example, the next page buttons work flawlessly during the first viewing on the iPad. But from the second time they functions awkwardly. The Next page button on Page 1 stops functioning. The one on Page 2 takes me back to Page 1.

    Same issue-- and it's been  a few weeks now.  As far as I can tell it is a waiting issue
    This is from Page 68 from USING DIGITAL PUBLISHING SUITE
    help.adobe.com/en_US/digitalpubsuite/.../digitalpubsuite_help.pdf
    Last updated 3/23/2012
    Use the iPad Viewer to preview content
    The Adobe Content Viewer for the iPad is a generic version of the viewer used for testing the digital content you create on the iPad. The iPad viewer is updated whenever the Folio Producer tools are updated.
    Note: However, when a new set of tools is released, folios you create with those tools may not work properly until Apple approves the new viewer version. If you try to open the folio, a “Please update your app” message appears. If you have a Professional or Enterprise account, you can create a custom version of the Adobe Content Viewer. See
    “Create a custom Adobe Content Viewer for iPad” on page
    98. Otherwise, hold off on updating the tools or use the Desktop Viewer until Apple approves the updated viewer.

  • Adding button functionality

    I want to add a simple button to a really basic html page with nothing but that button.
    When the button is clicked it should open up my form in a suitably sized popup window.
    Heres the form:
    <html>
    <head><title>Please enter search criteria</title>
    <script type="text/javascript">
    <!--
    // Form Validation
    function validateForm(fObj)
         alert("validating");
         var err = "";
         if(fObj["title"].value == ""){
              err += "- title\n";
         if(fObj["description"].value == ""){
              err +="- description\n";
         if(fObj["location"].value == ""){
              err +="- location\n";
         if(fObj["weather"].value == ""){
              err +="- weather\n";
         if(fObj["mood"].value == ""){
              err +="- mood\n";
         if(fObj["date"].value == ""){
              err +="- Date\n";
         if(fObj["time"].value == ""){
              err +="- time\n";
         if(err != ""){
              alert("The following fields contain errors, or are incomplete:\n\n"+ err);
                   return false;
         return true;
    function getSelectValue(selObject){
        return selObject.options[selObject.selectedIndex].value;
    function hasSelection(strField){
      return strField.selectedIndex > 0;
    function isChecked(strField){
    if (!strField.length) return strField.checked; // not a group
    for(var i = 0; i < strField.length; i++){
          if(strField.checked) return true; // yes one was ticked
    return false;
    function compareFields(strValue,strValue2){
    return strValue == strValue2;
    // -->
    </script>
    <link rel="stylesheet" href="styles.css" type="text/css">
    </head>
    <body>
    <FORM action=" AddMovieProfile.jsp" method="post" onsubmit="return validateForm(this)">
    <table width="240" border="0" cellpadding="5" cellspacing="0" background="backdrop.jpg">
    <tr>
    <td>
    <br>
    <table width="94%" border="0" cellpadding="0" cellspacing="2" align="center">
    <tr><td colspan="2" height="20" align="center"><font size="3" color="#0000aa"><b>Enter Search Criteria</b></font></td></tr>
    <tr><td>
    </td></tr></table>
    <br>
    <table width="100%" border="0" cellpadding="0" cellspacing="2" align="center">
    <tr><td><b>Title:</b></td><td align="center"> <input TYPE="text" NAME="title" size="20" maxlength="50"></td></tr>
    <tr><td><b>Description:</b></td><td align="center"> <input TYPE="text" NAME="description" size="20" maxlength="50"></td></tr>
    <tr><td width="100"><b>Location: </b> </td><td align="center"><input TYPE="text" NAME="location" size="20" maxlength="50">
    </td></tr>
    <tr>
    <td><b>Weather: </b> </td><td align="center"> <input TYPE="text" NAME="weather" size="20" maxlength="20" class="input"></td></tr>
    <tr>
    <td><b>Mood: </b> </td><td align="center"> <input TYPE =" text" NAME="mood" size="20" maxlength="20"></td></tr>
    <tr>
    <td><b>Date: </b> </td><td align="center"> <input TYPE =" text" NAME="date" size="20" maxlength="20"></td></tr>
    <tr>
    <td><b>Time: </b> </td><td align="center"> <input TYPE =" text" NAME="time" size="20" maxlength="10"></td></tr>
    </td></tr>
    <tr valign="middle"><td width="50%"><b>InOut:</b></td><td width="50%"><SELECT NAME="inout">
    <OPTION SELECTED> Indoors
    <OPTION> Outdoors
    <OPTION> Both </SELECT></td></tr>
    <tr><td colspan="2"> </td></tr>
    </td></tr>
    </table>
    <tr><td colspan="2">
    <table>
    <tr><td colspan="2" align="center"><input type=submit value="Submit Details!"></td></tr>
    <tr><td colspan="2" align="center"><input type=reset value=" Reset Form "></td></tr>
    </table> </FORM><br><br>
    </body>
    </html>

    The question is how do i do a plain html page with a
    button on it that has the functionality i mentioned,
    ie the button pressed event is that it opens a pop up
    window with my form in it.Ahh, I see. In that case, do as pgeuens suggests.

  • Changing simple button color

    It would seem as if this would be simple, but I'm not finding
    any documentation.
    I have a map of the US. Each U.S. state is a simple button.
    I'd like to change the button fill color (and potentially, the
    outline color) in AS3. I've created the buttons in Flash, not in
    AS3 (just graphically). How do I change the button fill color?
    Sample code:
    function addButtonListeners(btnInstance:SimpleButton) {
    btnInstance.addEventListener( MouseEvent.ROLL_OVER,
    handleRollover);
    btnInstance.addEventListener( MouseEvent.ROLL_OUT,
    handleRollover);
    addButtonListeners(Montana);
    addButtonListeners(NewMexico);
    addButtonListeners(Washington);
    Montana._color = 0xA6CsDA; //doesn't work

    I also tried this code, but I'm getting the error message:
    Access of possibly undefined property rgb through a reference
    with static type flash.geom:ColorTransform.
    Source: color.rgb = 0x00ff00;

  • Why do button functions included in external actionscript not persist across frames?

    this one drives me nuts!
    if i include an external actionscript file in frame one of my
    movie, then [as you'd expect] all the functions, global variables
    etc contained in that external AS file are available throughout my
    movie - with one notable exception.
    if i add a button to the stage - in a frame other than frame
    one - whose onRelease handler is defined in the external AS, the
    function is not called when the button is clicked - i have to
    re-include the external AS file again on the frame in which the
    button resides, in order for the buttons function to be called.
    anyone know why this is - and if there's a way round it?
    how come all the other functions in the AS persist across all
    frames and all timelines in the movie, but the button handlers only
    seem to be available on the actual frame in which the AS file is
    included?
    download
    example

    I think you and I are dealing with similar issues and the
    root cause is referred to as "scope." The only difference between
    your and my problems is that your code is in an external as file
    and mine is on the timline. But in both instances, code that should
    work doesn't. Robert Reinhardt has covered this in an article at
    http://www.communitymx.com/content/article.cfm?cid=8E4DF.
    He is the author of the Flash Actionscript Bible series and so
    knows what he is talking about. I have been studying it for an hour
    and darn if I can understand the second page of it. I've asked for
    help myself about this at
    http://www.kirupa.com/forum/showthread.php?t=248316.

  • Creating a simple button in CS4...I'm missing something

    Okay....I'm just trying to create a simple button to test. I create a square, convert it to a button symbol. I click on the button and open the Actions window. The window says "current selection cannot have actions applied to it." Have I missed a step? I can add an action to a keyframe okay, but when I click a button, even just a simple button, it will not allow me to add an action to it?
    Anybody know what I'm missing?

    again, you cannot attach code to objects in as3.  you are going to attach code to a frame or you're going to create external as files/class files and i'm pretty sure that will be a bigger jump out of your comfort zone than attach code to a frame.
    you've already given your button an instance name (mybutton), so attached to the first frame that contains mybutton, in the actions panel paste the following:
    mybutton.addEventListener(MouseEvent.CLICK,f);
    function f(e:Event){
    navigateToURL(new URLRequest("http://www.adobe.com"));  // better to use adobe than apple in this forum.

Maybe you are looking for

  • Report Column Length Issue

    I have a report and no matter what I try I am unable to get the column width accurate or for it to not wrap the text. Currently using 'Application Express 2.2.1.00.04' I have gone through previous posts and have tried the following: 1. I have tried t

  • Looking for a simple calendar.. free

    I would like to add an event calendar to my web site. Your basic monthly calendar with the option of adding tool tip notes or popup windows to individual days. Searching both the Adobe extension page and other forums finds hundreds.. both free and fo

  • Speical GL Posting to one time A/R or A/P account

    Hello, Does SAP allows special G/L posting to one time A/P or A/R account? While trying to post, it just gave an error saying not possible. Any pointers to this will be useful. Thanks Kishore

  • ESS/MSS webdynpro customization...........

    Hi ,          I want to customize MSS WebDynpro iview in NW Developer Studio can anybody guide me for this ? How to perform this task ? If any Doc Available ? Can i use Visual Composer also? Thanks, Smita

  • Safari Flash error report

    Process: WebKitPluginHost [958] Path: /System/Library/Frameworks/WebKit.framework/WebKitPluginHost.app/Contents/MacOS /WebKitPluginHost Identifier: com.apple.WebKit.PluginHost Version: 6531.21 (6531.21.1) Build Info: WebKitPluginHost-65312101~1 Code