Using a movieclip symbol as a button AS 2.0

Juggling between AS 2.0 and 3.0 has me a bit perplexed. I
need to have a movie clip on the stage acting like a button, when
you rollover it the mc would be like in the over state of a button.
Finally when you roll out the mc will play the over state which I
will reverse the frames.
Can someone show me the correct actionscript for this ?
I'm confused as I tried this using actionscript for buttons
and it is not working. I also know the this_root or _parent comes
into play here.

mentlity,
> place inside first frame of main timeline
>
> new_mc.onRollOver = function()
> {
> _root.new_mc.gotoAndPlay("rollover")
You might want to consider replaying _root with another
object
reference. There are people who deem _root "evil" (I'm not
one of them),
and the reason for that is because the term changes its
meaning depending on
context. In other words, _root may not always mean what you
think it means.
If a stand-alone SWF, it means the main timeline, but if you
ever use
another SWF to load this one into it, then _root will refer
to the *other*
SWF's main timeline, which may not have a movie clip in it
with the instance
name new_mc.
My suggestion here would be to use the keyword "this":
new_mc.onRollOver = function() {
this.gotoAndPlay("rollover")
See how neat that is? In AS2, the point of view of that
function
belongs to new_mc, because the function is associated with
new_mc's
onRollOver event. In AS3, the point of view would belong to
the keyframe in
which the code appears.
David Stiller
Co-author, Foundation Flash CS4 for Designers
http://tinyurl.com/dpsFoundationFlashCS4
"Luck is the residue of good design."

Similar Messages

  • Rich Symbol feature for Buttons?

    Im making a site with menu links where the text size and font
    is the same, but the color is different for each one. So I can play
    about with changing the font etc ive used a simple script to make
    the colour editable, attached to the graphic type of symbol.
    This is working but what I really want is to do the same
    thing, but with the button type of symbol. This would allow me to
    design the rollovers and down states, while still having the font,
    size etc easily updatable.
    Is there a way of using the rich symbol feature for buttons
    or is it for graphics only?
    thanks

    I think i could get round this by making a button with a roll
    over state (say italic), then applying a style to the whole button
    and using the style to control the appearance. ( I know that styles
    are only updatable in CS4 but im thinking of upgrading).
    When a style is applied to a button it seems to override the
    appearance setting of the button (font, colour, etc).
    Say I wanted to have some buttons different colors, but have
    the other appearance elements controlled by the style applied,
    could i override the colour (or similar feature) some way? I would
    still need to have the style linked to update it.
    thanks

  • SimpleButton inside MovieClip Symbol

    I want to create various button panels contained in separate
    MovieClip(symbols) created and laid out in a movie clip. I want to
    use flash button objects on each panel. Then swap panels at will
    that bring the buttons along with the panel so all I have to do is
    call..panel1 = new panelOne; panel2 = new PanelTwo, etc...If I
    create a class for each button with its functionally built in how
    can I access the button from the panel? I figure I have to import
    the buttons in the panel class before it will work? I tried
    panel1.getChildAt(x) but that didn't seem to work. Do I have to
    dynamically add the buttons as children to be able to access them
    with actionscript.
    Thanks!

    From inside a movieclip you can talk to the _parent object/timeline using "_parent" to target it.  So if you wanted to tell the _parent to move to a certain frame, inside the movieclip you could use...
    _parent.gotoAndStop(some frame);
    Or if there was a function in the _parent you could use...
    _parent.someFunction();
    or maybe...
    _parent.someFunction(RoXYZ); // passing the RoXYZ variable as an argument
    And if you needed to target the main timeline from inside some buried movieclip, you can use _root instead of _parent.

  • Controlling a symbol from a button inside of the symbol

    I hope this explanation makes sense:
    I have an animate file with buttons on the main stage that control symbols.
    (buttons are circles labeled 1876 and 1877)
    The symbols simply move a png image on and off the stage.
    For example, the two circles labeled 1876 and 1877 are PNG files made into buttons that control two different symbols.
    The symbols move the scoreboard image on and off the stage.
    Within the scoreboard image is an X, that I am hoping to put a button on top of within the symbol to close the symbol.
    The code I am using to move the symbols on and off the stage is:
    var current = sym.getVariable("current");
       if (current != "") {
          sym.getSymbol(current).play("out");
          sym.getSymbol("syboard1876").play("in");
       else {
          sym.getSymbol("syboard1876").play("shortIn");
       sym.setVariable("current", "syboard1876");
    syboard1876 is the green board png.
    Any idea how i can get the symbol to move off of the stage by tapping it?
    And will I be able to have multiple buttons beneath the symbol (that are hidden beneath the b=green board when it is visible)?
    This was the original tutorial I adapted the get the animation to work so far.
    Tutorial: Leveraging Independent Symbol Timelines « Adobe Edge Animate Team Blog
    Now I just need to figure a way to give the user the ability to tap the X to close the symbol.
    Any suggestions?

    you could use $each() with jquery in compositionReady
    if not you need to get back to stage with sym.getComposition().getStage() or
    you could use this in compositionReady
    function useButtons(element) {
    sym.$(element).bind("click",function() {
      sym.$('image').attr('src','images/'+element+'.png').css({"opacity":1.00});  // this is a code example - I used the same name for the buttons and image names.
    // add button names here
    ['', '','' ,'',''].forEach(useButtons);

  • How can you determine which pages are using a specific symbol?

    I want to find all the pages that are using a specific symbol, but I don't know how.  I can't simply switch symbols because some have specific text & want to switch them with more generic smart buttons.  I'll have to find every instance to update the text.
    thanks!

    me too, my file has 39 pages with many unuse symbols, now I want to delete those unuse.
    I found that after deleteing those unuse in Page 1, actually they are being used in other page,
    I can't find the way to delete them all at one time for all pages.
    and I am using CS3

  • 3d Tween inside a movieclip symbol

    Hi everyone,
    There is probably a quick answer to this.   Here is the situation,  I have an .FLV in one layer of a movieclip symbol and on a different layer have some dynamic text that I am trying to rotate with an obect in the .FLV.   I figured this would be a great use of the 3d tween for this text.   The problem is that when I bring this MovieClip Symbol (with the 3d tween and .FLV which works in the symbol editor)   depending on where I place this clip on the stage I get different results from the 3d tween negating the desired effect.   For various reasons I must have the effect in the same MC with the .FLV.   Any ideas on why this happens, or how I can bypass it?

    you must publish for fp 10 to use this class.  check the flash help files to read about it.
    usage is not difficult.  so, if you want 3d transforms of yourobj to be relative to yourobj's center, use:
    var pProjection:PerspectiveProjection=new PerspectiveProjection();
    pProjection.projectionCenter = new Point(yourobj.width/2,yourobj.height/2);
    yourobj.transform.perspectiveProjection = pProjection;

  • Copying or duplicating a movieclip symbol

    I ran into a problem, I have a movieclip symbol which is on the maintimeline in a scene. In the next scene I need the exact same elelments in the previous movieclip but in this scene I need to animate the location back anfd forth.
    I figured I would copy the mc and rename then rename the elements that made the clip.
    No good as it changes the names elements from the orignal mc.
    Then I tried to duplicate the mc and when I tried to rename the elements inside I get the same problem.
    Just dso I'm clear here is a for instance:
    original mc is called handOne, inside that clip is an image of a hand  on one line and a blinking number looping on another line.
    this clip is stationary in the scene on the main timeline.
    Now
    I need the same exact clip in the next scene but this time it needs to move across the stage.
    Any help?
    R

    If you want another instance of the symbol it will get another name since you need a different ID for 2 elements in the DOM.
    But if you want to duplicate the symbol to make another one slighlty different, then you duplicate in the library - not the elements panel.
    If you have 2 instances of the same symbol you should be able to make them do different things without affecting the first instance.
    When a symbol is played entirtely you need to reset it to the beginning if you want to use it again unless it is a looping symbol. you reset with stop(0);
    Since I am not sure what you are doing, I am not sure how to advise you but I hope this helps.

  • Is it possible to convert characters to movieclip symbols?

    I want to do something like when ppl type in some texts, the
    program will convert every character of the text to a movieclip
    symbol, so I can animate individual characters. Is there a way to
    do something like that?
    Thx in advance~

    yes, you can create (in the authoring or with a.s.) a
    movieclip that contains a textfield and you can assign a linkage id
    to the textfield.
    you can then use the flash string methods to assign each
    letter to its own movieclip/textfield (that you created in the
    first paragraph) using attachMovie(). position your letters and
    animate or animate the movieclip in the first paragraph in the
    authoring environment by putting that movieclip into a timeline and
    use a frame based animation. remove the linkage id on the
    non-animated movieclip with a textfield and assign a linkage id to
    the animated movieclip (that contains your movieclip that contains
    your textfield).

  • Problems using addchild method to dynamically load buttons

    Hello,
    I have researched the internet for about a week now losing sleep trying to figure this out.  Can someone help me?  I have an fla file with Quiz question.  For example:
    on frame 50 I have images and radio buttons, a submit button with an instance name of submit_btn with the question The first capital of the United States
    was New York City as a static text.  The action for this frame is:
    stop();
    import fl.controls.RadioButtonGroup;
    var radioGroup1:RadioButtonGroup = new RadioButtonGroup("TriviaQuestion 1");
    rb3.textField.autoSize = TextFieldAutoSize.LEFT;
    rb1.label="True";
    rb2.label="False";
    rb3.label="NY is not in the US";
    rb4.label="NY is a City";
    rb1.group=radioGroup1;
    rb2.group=radioGroup1;
    rb3.group=radioGroup1;
    rb4.group=radioGroup1;
    submit_btn.addEventListener(MouseEvent.CLICK, submitClick);
    function submitClick(event:MouseEvent):void {
    if(radioGroup1.selection == null) {
    return;
    if(radioGroup1.selection.label == "True") {
    status_txt.text=radioGroup1.selection.label+ " is correct! Well done.  The first capital of the United States was New York City in 1789.";
    }else {status_txt.text=radioGroup1.selection.label+ " is incorrect! Try Again.";
    next_btn.addEventListener(MouseEvent.CLICK, nextOnClick);
    function nextOnClick(event:MouseEvent):void
    gotoAndPlay(55);
    Now my movie works fine this way.  What I want to do is practice adding the navigations (prevButton, nextButton and finishButton) with the addchild button in an AS file (linking it in the document properties).  I have done this if I add the questions as well but a little confused on how to make the navigation work if the questions are already on a time line.  So far this is what my ClassButton.as file looks like  (can't figure out how to import the questions);  If I get the prevhandler correct, the rest will be easy.
    package
    import flash.display.MovieClip;
    //import flash.display.Sprite;  <<fla file went crazy when I used Sprite verses MovieClip
    import fl.controls.Button;
    import flash.events.MouseEvent;
    import flash.text.TextField;
    import flash.text.TextFieldAutoSize;
    import fl.controls.RadioButtonGroup;
    public class ClassButton extends MovieClip {
    //handling questions: --this is the big problem..don't know how to import RadioButtonGroups
    private var quizQuestions:RadioButtonGroup;
    //private var currentQuestion:QuizQuestions;
    //private var radioGroup:RadioButtonGroup;
    private var currentIndex:int = 0;
    //buttons:
    private var prevButton:Button;
    private var nextButton:Button;
    private var finishButton:Button;
    //scoring and messages:
    private var score:int = 0;
    private var status:TextField;
    public function ClassButton() {
    createButtons();
    //createQuestions();
    /* little confused on what function to create to add questions
    private function createQuestions() {
    radioGroup = new RadioButtonGroup;
    //create previous, next and finish button
    private function createButtons() {
    var yPosition:Number = 505;
    prevButton = new Button();
    prevButton.label = "Previous";
    prevButton.x = 50.35;
    prevButton.y = yPosition;
    prevButton.addEventListener(MouseEvent.CLICK, prevHandler);
    addChild(prevButton);
    nextButton = new Button();
    nextButton.label = "Next";
    nextButton.x = prevButton.x + prevButton.width + 40;
    nextButton.y = yPosition;
    //nextButton.addEventListener(MouseEvent.CLICK, nextHandler);
    addChild(nextButton);
    finishButton = new Button();
    finishButton.label = "Finish";
    finishButton.x = nextButton.x + nextButton.width + 40;
    finishButton.y = yPosition;
    //finishButton.addEventListener(MouseEvent.CLICK, finishHandler);
    addChild(finishButton);
    private function showMessage(theMessage:String) {
    status.text = theMessage;
    status.x = finishButton.x + finishButton.width + 40;
    status.y = 505;
    /* blocked this out because it's incorrect.  the problem is the property (currentQuestion and quizQuestion)
    private function prevHandler(event:MouseEvent) {
    showMessage("");
    if(currentIndex > 0) {
    currentQuestion.visible = false;
    currentIndex--;
    currentQuestion = quizQuestions[currentIndex];
    currentQuestion.visible = true;
    else {
    showMessage("There are no previous quesions. This is the first question.");
    How do I make these buttons - next, prev and finish -  work for the questions using the addchild method in a separate AS file linked to the FLA file?  Is there a way to import the RadioButtons?  Is this possible.

    Check out this Nugget.
    It contains code that should help you get started.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Switching images used as a symbol late in development

    Does anyone know a way to switch the image you are using as a
    symbol later in the development stage? Lets say you edit an image
    in Fireworks, then convert it to a symbol, then copy and paste it
    into Flash and use it throughout the movie. Is there a way to later
    on change the image to an updated one? Say you cleaned it up more
    in FIreworks, can you somehow change the symbol to use that new
    image, while preserving the positioning and tweens and effects
    placed on it throughout the movie?

    That's the beauty of symbols. If you've converted it to a
    symbol then open the symbol in your library and swap out the image.
    You'll see that all instances of the symbol will automatically
    update throughout the movie. You can also update the image. If the
    file name is the same but you've modified it in an external editor,
    then double-click on the Bitmap in the library and click the
    "Update" button.

  • How to remove a MovieClip symbol and stop it?

    I manually create a movieclip symbol and given instance name "Ball" on stage (not new MovieClip in AS), and it contained 20 frames animation, but after when I click a button to remove it "removeChild(Ball);", I don't know why it still running? although I can add a "stop()" code on 20 frame to stop it, but I don't think that is a good solution.
    I try to remove its Event.ENTER_FRAME, but I don't know how to do it? because I don't know its event function name.
    Could anyone explain it?

    I believe that in order to fully destroy a MovieClip (and allow it to be garbage collected) there must be no references to it, and it can't be doing anything.
    Here's what I tried:
    mcBall.stop();
    removeChild(mcBall);
    mcBall = null;
    I believe that destroyed the MovieClip. Can anyone else confirm this?
    Michael

  • Movieclip symbol into library

    Hi,
    anyone has an idea when and why movieclip symbol become green in library when i export actionscript file with that movieclip?
    thanks

    u wanna see rude... not using the search... or looking through the topics that are two minutes old... i dont care about answering them but i dont like answering them every 2 minutes... look for all posts by me.

  • Ipod shows locked symbol  but lock button off

    My ipod nano 3rd generation on the screen is showing the locked symbol and the button for it is off like not showing orange. I have restored it 3times and you cant reset it because you cant use the buttons! hooks up to the computer fine and syncs fine but still locked

    I have the same problem. It occured over the weekend. My 3rd gen nano was working fine. At some point while charging it became locked. I've restored it three times and it stays lock. None of the buttons works, but it does charge and sync fine.

  • How to use the separate symbol in the text field in the adobe form.

    Hi,experts,
    I don’t know how to use the separate symbol to make a paragraph separate into several lines correctly in the text field in the adobe form.
    Action:
    1. config the ADS successfully.
    2. create the adobe form with a mult-line textfield(binding the 'remark' context in the interface of the form) using sfp.
    3. create a WDA for invoke the form and transfer the 'remark' context data.
    I use the following codes to display the paragraph in the PDF document:
    CONCATENATE
    '1&#12289;aaaaaaaaaaa&#65307;'
    '2&#12289;bbbbbbbbb '
    '3&#12289;ccccccccccc'
    '4&#12289;ddddddddd'
    INTO remark .
    lo_nd_z_hr_php_payslip->set_attribute(
    EXPORTING
    name = `REMARK`
    value = remark ).
    But I found all the content aren't paragraph separate correctly in the text field in the adobe form when I run the WDA.
    Could you please give me some hints to make the paragraph separate correctly in PDF document? Thanks a lot in advance!
    My email is : [email protected]
    Best regards,
    Tao
    Edited by: wang tao on Apr 8, 2008 1:58 AM

    Hi,
    If it is just a one word value then you could use this in the exist event;
    this.rawValue    
    = util.printx(">?<*",this.rawValue);
    This changes the first character (represented by the ?) to uppercase (represented by the >) and all trailing characters (represented by the *) to lowercase (represented by the <).
    If you wanted something more general ... if they could also enter a middle name then you could call a function like;
    function        toTitleCase(textValue)
      return  textValue.toLowerCase().replace(/\b[a-z]/g, function replacer(match) { return match.toUpperCase(); });
    This uses a regex to change all lowercase letters following a word boundary to uppercase.
    Bruce

  • How to use the separate symbol in the textfield in adobe form?..urgent

    Hi,experts,
    I don’t know how to use the separate symbol to make a paragraph separate into several lines correctly in the text field in the adobe form.
    Action:
    1. config the ADS successfully.
    2. create the adobe form with a mult-line textfield(binding the 'remark' context in the interface of the form) using sfp.
    3. create a WDA for invoke the form and transfer the 'remark' context data.
    I use the following codes to display the paragraph in the PDF document:
    CONCATENATE
    '1&#12289;aaaaaaaaaaa&#65307;'
    '2&#12289;bbbbbbbbb '
    '3&#12289;ccccccccccc'
    '4&#12289;ddddddddd'
    INTO remark .
    lo_nd_z_hr_php_payslip->set_attribute(
    EXPORTING
    name = `REMARK`
    value = remark ).
    But I found all the content aren't paragraph separate correctly in the text field in the adobe form when I run the WDA.
    Could you please give me some hints to make the paragraph separate correctly in PDF document? Thanks a lot in advance!
    My email is : [email protected]
    Best regards,
    Tao
    Edited by: wang tao on Apr 8, 2008 2:05 AM
    Edited by: wang tao on Apr 10, 2008 10:29 AM
    Edited by: wang tao on Apr 11, 2008 5:29 AM

    With the pen tool in Indesign, is there a way of making the points not join if you want to make a few single lines?

Maybe you are looking for

  • Very new to ARD. Quick question re: Cannot connect to client

    I will try to be brief here. I have a MacBookPro running ARD 3. I stay in conntact with my 86 year old mom with iChat and have controlled her emac with ARD 2.2 in the past. She has moved to a new home and nothing changed on her machine. I upgraded to

  • New user - how do i synch movies with the iphone

    hello i have just purchased an iphone and before this i had been creating movies as mp4 files to transfer, however whn i connect to itunes i am able to transfer the files from a purchased show that appear in Tv shows but the files that appear as movi

  • PRESTO GIGABIT PRO Ethernet Card not detected in Mac OS 10.5.8

    Hello, I am an IT Technician who is troubleshooting an issue with the network card on a PowerMac G5 tower. I have installed the PRESTO GIGABIT PRO Ethernet card (which states that it is compatible with Power Mac G5 (with PCI or PCI-x slots). After I

  • Trying to open nikon Df raw files, can't reach update server

    I can not seem to reach the update server to update the plugins for photoshop so that it can open Nikon Df raw files. Is there a way to manually download the update/plugins from some other server? Roger

  • Delete Access Issue for a Provisioned Resource in OIM..

    Thank you for the help provided for revoking the resource.I am able to revoke the resource from the User profile details. But I have to revoke the resource from the delete access in the same way as I have done for add access for provisioning a resour