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.

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.

  • Attach movie clips to scrollPane using attachMovie

    Hi
    I tried to attach movie clips to scrollPane using attachMovie
    but could not do it
    I tried the following code:
    sp.contentPath="emptyMovieClip"
    sp.content.attachMovie("boxesRow","boxesRow1",1)
    trace(sp.content.boxesRow1)
    Im able to trace the sp.content.boxesRow1 , but not seen in
    the scrollPane
    Can any one suggest me , how can I do this
    Pleaseeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
    Thank you very much

    hi,
    The code is correct....
    But, what i want to know is, are using the Identifier name of
    the moviclips ???
    "emptyMovieClip" should be an Ideintifier name for an empty
    clip in the library.
    and "boxesRow" should refer an identifier name of another
    movie clip in the library...(its should also contain some object
    for the visibility check)...

  • Attach Movie Clip to ScrollPane

    Hi
    I tried to attach movie clips to scrollPane using attachMovie
    but could not do it
    I tried the following code:
    sp.contentPath="emptyMovieClip"
    sp.content.attachMovie("boxesRow","boxesRow1",1)
    trace(sp.content.boxesRow1)
    Im able to trace the sp.content.boxesRow1 , but not seen in
    the scrollPane
    Can any one suggest me , how can I do this
    Thank you very much

    hi,
    The code is correct....
    But, what i want to know is, are using the Identifier name of
    the moviclips ???
    "emptyMovieClip" should be an Ideintifier name for an empty
    clip in the library.
    and "boxesRow" should refer an identifier name of another
    movie clip in the library...(its should also contain some object
    for the visibility check)...

  • Attaching movie clips to other movie clips

    I have mc1 nested like this
    _root.mc3.mc2.mc1;
    If i want to attach the mc1 from within mc2 timeline to the
    _root timeline how can I do this?... I don't want to reattach it
    from the library it must be the nested mc1 that is attached to the
    root timeline.
    Is there a way to attach movie clips to other m.c's in this
    way?
    regards J

    I've spent nearly a year creating this site... I just taken a
    glance at AS3. And sizeable isnt wrong... mamouth is closer. Other
    than having to learn AS3 it would take me months to rewrite
    everything. Is AS3 actually that much better than AS2? Either way
    im gonna finish the site in AS2 and try and find a work around for
    my attaching mc's to other mc's. Maybe one day I will convert it,
    but it just looks like an unnecissary headache.
    Thanks for your help. J

  • 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

  • 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?

  • 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);
    };

  • Attach movie clip + INVISIBLE

    hey,
    is there a way to attach a movie clip and make the object
    INVISIBLE (i.e. make the object's alpha 0 as it is attached).
    here's the line of code to attach the clip:
    holder.attachMovie("frame1", "frame1_mc", 20, {_x: 30, _y:
    35});
    -donkeyboy

    you can set any additional properties inside your brackets:
    holder.attachMovie("frame1", "frame1_mc", 20, {_x: 30, _y:
    35,_visible:false})
    or
    holder.attachMovie("frame1", "frame1_mc", 20, {_x: 30, _y:
    35,_alpha:0})

  • Attach movie clips using seperate functions

    I'm having a little trouble with the following code. I'm
    calling two functions: init() and inittwo() to attach some movie
    clips to the stage. If I comment one of them out, the other works
    fine and the movement is okay. But as it is, only the "cloud" movie
    clips are being attached. I need for the clips in the "dreamarray"
    to be attached, and then for the "clouds" to be attached with a
    second function. I'm probably not going about this the right way,
    but I could sure use some help!
    It would also be cool if I could attach the dreams at set "x"
    values instead of random distribution. I'm not sure how to set a
    seperate x value for each item in the array being attached.
    var numClouds:Number = 10;
    var fl:Number = 250;
    var gravity:Number = .5;
    var vx:Number = 0;
    var vy:Number = 0;
    var vz:Number = 0;
    var friction:Number = .97;
    var vpX:Number = Stage.width / 2;
    var vpY:Number = Stage.height / 2;
    var vpY:Number = 400;
    var dreamarray:Array = new Array();
    dreamarray[0] = "dreamone";
    dreamarray[1] = "dreamtwo";
    dreamarray[2] = "dreamthree";
    init();
    inittwo();
    function init() {
    for (var i:Number = 0; i<dreamarray.length; i++) {
    var dream:MovieClip = attachMovie(dreamarray
    , "dreamarray" + i, i);
    //var dream:MovieClip = attachMovie("dreamone", "dreamone" +
    i, i);
    dream.x = Math.random() * 1600 - 800;
    dream.y = 50;
    dream.z = Math.random() * 800;
    //trace("functioncall");
    //tree.x = Math.random() * 2000 - 1000;
    //tree.y = 50;
    //tree.z = Math.random() * 10000;
    function inittwo() {
    for (var j:Number = 0; j<numClouds; j++) {
    var cloud:MovieClip = attachMovie("cloud", "cloud" + j, j);
    //tree.x = 400;
    cloud.x = Math.random() * 1600 - 800;
    cloud.y = 50;
    cloud.z = Math.random() * 800;
    function onEnterFrame():Void {
    if(Key.isDown(Key.UP))
    vz -= 1;
    else if(Key.isDown(Key.DOWN))
    vz += 1;
    if(Key.isDown(Key.LEFT))
    vx += 1;
    else if(Key.isDown(Key.RIGHT))
    vx -= 1;
    if(Key.isDown(Key.SPACE))
    vy += 1;
    vy -= gravity;
    vx *= friction;
    vy *= friction;
    vz *= friction;
    for (var i:Number=0;i<dreamarray.length;i++) {
    //i think there is a error here
    var dream:MovieClip = this["dreamarray" +i];
    dream.x += vx;
    dream.y += vy;
    dream.z += vz;
    if(dream.y < 200)
    dream.y = 200;
    vy = 0;
    if (dream.z <= -fl) {
    dream.z += 1000;
    else if(dream.z > 1000 - fl)
    dream.z -= 1000;
    var scale:Number = fl / (fl + dream.z);
    dream._xscale = dream._yscale = scale*100;
    dream._x = vpX + dream.x * scale/2;
    dream._y = vpY + dream.y * scale/2;
    //dream._x = dream.x * scale/2;
    dream._alpha = scale * 60 + 40;
    dream.swapDepths(-dream.z);
    for (var j:Number=0;j<numClouds;j++) {
    var cloud:MovieClip = this["cloud" + j];
    cloud.x += vx;
    cloud.y += vy;
    cloud.z += vz;
    if(cloud.y < 50)
    cloud.y = 50;
    vy = 0;
    if (cloud.z <= -fl) {
    cloud.z += 500;
    else if(cloud.z > 10000 - fl)
    cloud.z -= 10000;
    var scale:Number = fl / (fl + cloud.z);
    cloud._xscale = cloud._yscale=scale*200;
    cloud._x = vpX + cloud.x * scale;
    cloud._y = vpY + cloud.y * scale;
    cloud._alpha = scale * 60 + 40;
    cloud.swapDepths(-cloud.z);

    Hi Ive just taken a very quick look at your code and Ive
    noticed at least one or two mistakes.
    you are calling:
    init();
    inittwo();
    before the actual functions have been declared.
    Flash works from top to bottom when actioning code so by
    calling:
    init();
    inittwo();
    bofore the function has been declared and this will do
    nothing as it cannot find the functions to call as they have been
    declared AFTER the function calls.
    The best thing to do is put any calls right at the bottom and
    then you will know everything is ready to be triggered.

  • Attach movie clip

    Hello i asked this in my another topic but that topic was
    mainly related with another problem.
    my question is;
    i have 3x3 square boxes ( "box_mc"s movie clips duplicated
    from 1 "box" movie clip on stage)
    I want to put a small box (that is movie clip "smallmc") in
    front of bigger one(that is one of another mc "box_mc" already
    placed on stage). When i click big box( i mean "box_mc") i want to
    attach an instance of "smallmc" in front of big one.
    i have this code in "box" mc ;
    on (press) {
    if (this.selected == 0) {
    trace("box is selected");
    selected = 1;
    _root.attachMovie("smallmc","smallmc"+count,getNextHighestDepth(),{_x:this._x,_y:this._y} );
    _root.count++;
    trace(_root.count);
    } else {
    trace("unselected");
    selected = 0;
    _root.count--;
    trace(_root.count);
    but this code puts "smallmc" under "boxmc" :(( and 1 more
    problem ;
    i have 3x3 big boxes; and when i click a "boxmc" it puts 1
    smallmc then i click another "boxmc" it puts "smallmc" but previous
    one dissappearing.(but this is not prior problem i think first i
    should put small boxes in front of big ones)
    thank you for your all helps advices

    Not sure if this will help but: getNextHighestDepth() is not
    a standalone
    method - it is a method of a MovieClip. You need something
    like:
    this.getNextHighestDepth() instead.
    Dave -
    Adobe Community Expert
    www.blurredistinction.com
    http://www.adobe.com/communities/experts/

  • 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.

  • 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

  • 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 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");

Maybe you are looking for

  • Making a Client & Server app with UDP

    Hello fellahs, as the title of this post says I'm making a client and server application. The server are supposed to handel several clients, and the communication is done true UDP. I have got two questions concerning this. The first one is if a excep

  • Documents not posted to cost center

    Hi, The documents are posted into sap from third party system through interface. And in the transaction OKB9 (default account assignment), cost center is assigned to the particular GL account. The FI document displays that particular GL account conta

  • HDX16 with Blu Ray that stops or lags video playback

    My HDX16 laptop is nearly out of warranty (1 month left) and I need some advice. I honestly can't say I remember watching a blu ray movie on my laptop all the way through until a month or 2 ago. I normally use my PS3. In any case, when watching Jenni

  • HT1657 I'm getting a 42110 error when I try to play my rented movie.  I've downloaded the movies twice but it's saying they aren't downloaded !

    I'm getting a 42110 error when I try to play my rented movie from the istore.  I've downloaded the movies twice but it's saying they aren't downloaded !

  • OLAP Patch problem

    Hi everybody, I had some a bad experience with OLAP Patch. First of all it doesn't work for international users. The problem: you have to alter (as always >:( ) the "Program Files" dir to portuguese's "Arquivo de Programas" in the configuration assis