Referencing movie clips

Help me, I'm completely stuck.
All I want to do is make a button when pressed, change the
frame of another movie clip at the same hierarchy as it (the button
and clip have the same parent clip).
I've tried this and it doesn't work:
_parent.pdf2.gotoAndPlay(2);
pdf2 is the name of the clip I want to change.
Any help is apprecieated.

if your button is on the same timeline as pdf2 use:

Similar Messages

  • Referencing HTML page from within a movie clip

    Hi
    Hope someone can help with this.
    I have a simple horizontal scrolling gallery of 24 thumbnails
    in Flash, the thumbnail images are loaded into the boxes using
    actionscript. I would like each thumbnail to link to a html page of
    my choice. There is a movie clip instance called panel with the 24
    buttons inside it and on the first button as a test I've placed the
    following action script:
    on (release) {
    getURL("team.html","_self");
    When testing this movie from within Flash (CTRL, ENT) the
    button links to the html file (which is in the same folder as the
    SWF) with no problem. The problem is when I preview the page in a
    browser and try to click on the first button nothing is happening.
    I've tried it in both IE7 and Firefox with the same result.
    The flash thumbnail clip is placed as a flash object into a
    html page using dreamweaver.
    I'm sure this is something simple such as navigating the
    timeline but I've tried a few things like _root. but still no joy.
    Hope someone can help.
    Thanks, Jo

    Try
    on (release) {
    getURL("
    http://site.com/team.html","_self");
    }

  • Referencing a movie clip by using a variable

    I have been using this line of code to fade in a movie clip:
    new Tween(background_mc, "_alpha", None.easeNone, 0, 100, .5, true);
    Now, I want to accomplish the same thing, only this time by using an element from an array (bg_array[currentSlideNumber]) that stores the instance name "background_mc"
    I've tried the following, but it doesn't work:
    new Tween(bg_array[currentSlideNumber], "_alpha", None.easeNone, 0, 100, .5, true);
    What am I doing wrong?
    Thanks

    You are telling flash to look inside that array and tween the _alpha property of the string -- because instance names are strings -- "background_mc" from 0 to 100. But generally speaking a string doesn't have an _alpha property.
    What you really want to do is tell flash, look inside this array find the string then use that string to look inside another array -- the array of all objects on some timeline -- to find a clip and then tween its _alpha property. That sounds like a lot, but it only adds a little bit to your code.
    new Tween(this[bg_array[currentSlideNumber]], "_alpha", None.easeNone, 0, 100, .5, true);
    I'm assuming the code is on the same timeline as background_mc?
    Annother approach would be to store instance references instead of the names. I'm not sure how you are creating the background, but instead of putting the name into the array, put a reference. So if you were using attachMovie you could do something like this.
    var bg_array:Array=new Array()
    var tempVar:MovieClip=this.attachMovie("background","background_mc",100);
    bg_array.push(tempVar);
    Finally, and not to anything you've asked about, but don't you find the suffixes annoying? Why, bg_array and background_mc? If you type your variables you will still get code completion and you will have less to type and your code won't be so long. I just find that having to type those underscores and all makes me likely to make mistakes and makes it much harder to read the code. Just a thought.

  • Referencing duplicated movie clips

    I am using the following script to duplicate the movie clips
    pixel.duplicateMovieClip("pixel"+i,
    this.getNextHighestDepth(), {_x
    , _y:m});
    how can I get the x and y values for the duplicated clips, I
    tried assigning a text box with variable xget an d wrote the
    script:
    xget = pixel+i._x
    how should I be scripting this?

    you could do something like:
    xget = eval("pixel" + i +"._x");
    -or-
    xget = this["pixel" + i]._x;
    Either one could work...

  • How to _root in as3 (buttons in movie clip referencing to main timeline)

    Hi, I created buttons within a movie clip that i placed in the main timeline.I am  a novice to as3. I just wanted the button to go to the frame label of the main timeline. i used to do this with _root in the old flash. how do i do this?
    thumb02_btn.addEventListener(MouseEvent.CLICK, buttonClicked);
    function buttonClicked(event:MouseEvent):void
        gotoAndPlay("slide2");

    Thanks for the quick reply!
    somehow i must be doing something wrong though. It's not working...
    I added a stop to the "slide02" labeled section of the main timeline.
    and I also added a stop to the beginning and end of the movieclip. Am I doing something wrong? attached is my file....thanks!!
    stop();
    thumb02_btn.addEventListener(MouseEvent.CLICK, buttonClicked);
    function buttonClicked(event:MouseEvent):void
        MovieClip(this.root).gotoAndPlay("slide2");
    stop();

  • Needs help adding images to movie clips and referencing the frames

    i havent started with a blank, script made movie clip.
    I want to add frames from action script 2, and be able to
    reference/show the induividual frames for a video game and not a
    movie. I dont realy need animation, i just need certain frames to
    show, that i want to load load(from a non script made movie clip
    with one loaded frame(bitmap data).

    you can't add frames to a movieclip using actionscript. so,
    if that's what you're trying to do you'll need to find some other
    way to accomplish your goal.

  • Yellow triangle and a grayed out movie clip

    Hi, I created a project in iMovie 08, kind of elaborate for me, with several movie clips, each with a transition, and background music from iTunes through out the majority of the 3 minute and 30 second final project. Initially, all was well and the project played perfectly. A couple of days later when I went into iMovie 08 to enhance the project, several clips were grayed out and had a yellow triangle in the clip. Placing the cursor over the clip resulted in the clip "coming to life" that is revealing the clip but the clip was not visible in the browser and the grayed out clips were not visible if I played the project in full screen mode. If I published the project to the web, the grayed out clips would not show (the video portion); the audio which was part of the whole project would play. I do not think I moved any clips to a different location although I certainly added other clips to iPhoto and then to iMovie. I just finished the lynda.com training on iMovie 08 which was just released and I got no help from that training on the yellow triangle problem. Any help or ideas would be appreciated. Thank you.

    Great news! After some browsing around, I located the problem, and now my movie project is fixed!
    As it turns out, videos that are located in iPhoto are referenced based on the Event that they belong to, which means that if you change the name of the Event that the picture belongs to then iMovie will no longer be able to find your picture. (This is also why the clips appear in the lower section of iMovie, because they are still there, just in a renamed or merged event.)
    I was able to fix the problem very easily by renaming my event back to the original name, and then after closing and restarting iMovie all the nasty little yellow triangles were gone and all my clips were back as if they'd never left.
    This may or may not help, but for me, to make sure that I got the event name correct, I found the movie file (which was in "Movies/iMovie Projects") and then right mouse clicked and selected "Show Package Contents" so that I could see what was in my project, and then opened the "Project" file, which had the names listed in it. Hope that helps!
    Trigby

  • Accessing a Movie Clip in a parent Scene.

    Setup:
    *Scene 1:
      - MovieClip1
      *Inside MovieClip1:
       - Actions:
         stop();
         next_btn.addEventListener(MouseEvent.CLICK, onNextButtonClicked);
         previous_btn.addEventListener(MouseEvent.CLICK, onPreviousButtonClicked);
         function onNextButtonClicked(e:MouseEvent):void {
         if (currentFrame == totalFrames) {
         gotoAndStop(1);
         } else {
         nextFrame();
         function onPreviousButtonClicked(e:MouseEvent):void {
         if (currentFrame == 1) {
         gotoAndStop(totalFrames);
         } else {
         prevFrame();
        (THIS CODE IS FOR MY NEXT AND PREV BUTTON TO CYCLE THROUGH MY PIECES OF WORK)
       Then I have...
      - Pieces of work Layer:
        This includes each piece on a single frame, with a label name. (5 total frames on this layer)
        Then I have....
        - Next and Prev buttons on a layer
        And Finally....
       - The last layer in this scene has a background frame.
    ***** Now inside each frame containing each piece of work there is:
           1st Layer = Actions
           Containing this code: stop();
           2nd Layer = This is the movie Clip that Fades my pieces of work in.
       ****** Inside this movie Clip of the piece of work fading in will contain:
               1st Layer = Actions
               Containing this code:
    stop();
    function openLabel(event:MouseEvent):void {
    switch (event.currentTarget) {
    case identity_cplogo_btn :
    gotoAndPlay("cplogo_lv");
    break;
    identity_cplogo_btn.addEventListener(MouseEvent.CLICK, openLabel);
    2nd Layer = 1st frame blank, then frame 2-10 contains a movieclip with a label of cplogo_lv. This movie clip is the clip that has a large view of the image popup and darken the background. (Like a lightbox effect)
    3rd layer = the logo which is a BUTTON. THis is located on the first frame and is called "identity_cplogo_btn." So when this is clicked it opens the large view.
    *****Now....
    When I click inside the movieclip that is the lightbox effect and go inside of it there is.....
    1st Layer = Actions with the code of:
    stop();
    function openLabel(event:MouseEvent):void {
    switch (event.currentTarget) {
    case lv_close_btn :
    gotoAndPlay("return");
    lv_close_btn.addEventListener(MouseEvent.CLICK, openLabel);
    ****After the actions keyframe, which is locate on frame 10, there is a label called "return" from frame 11-24. It is a blank label meaning there is nothing on it but the label name.
    2nd Layer = the "Close" button which appears when the large view is opened and is located on frame 10 right underneath the action code.
    3rd Layer = This contains the Large view of the logo, which I have made a movie clip for making it fade in then I paste reverse frames after right underneath the "return" label making it fade out.
    4th Layer = Contains the Dark background that pops up which also fades in then underneath the "return" label it has its' reverse frames which are making it fade out.
    SO... I have the code making it so that when the "Close" button is clicked it is going to the "return" label which is making everything fade out.
    ***************************** NOW WHAT I NEED TO FIGURE OUT *************************************
    I need to know the code to be in the last movie clip I just explained and when I click the close button and it plays everything underneath the "return" label, THEN i need it to access the movie clip with the logo fading in so that it appears to go back to BEFORE clicking on the logo and expanding the view.
    I understand that this code will be places right after the "return" label so that when the return phase plays it will then play the code making it go to this movie clip then it will stop.
    I have tried
    MovieClip(parent.parent).gotoAndPlay("return_2");
    stop();
    And giving the movieclip that has the logo fading in the "return_2" label name. THis allows it to go to that movie clip, however, it doesnt play it is just blank on the screen.
    I also have tried accessing the movie clip after giving it an instance name, but it was doing the same thing.
    Help PLEASE!

    I actually tried a post earlier that was simplified, but I think the setup of scenes might be important....anyways, here it is.
    Setup:
    Scene 1 > MovieClip1 > MovieClip2 > MovieClip3 > MovieClip4
    Explanation:
    I am in MovieClip4, in which I have a "Close_btn" that when clicked, it takes you to label "return" (still inside MovieClip4), which then plays the movie clips in the layers below label "return." What I want it to do is....Once label "return" plays, I need the code to make it go into "MovieClip2" and play a movie clip with the "Instance" Name of "Logo_1."
    I have tried this by setting a label name above the movie clip and referencing the label, however, it does access that movie clip, but it doesnt play it...It is just blank.
    Hope this is understandable.

  • Access Button contained in a movie clip

    This is for beginners or those not familiar or having
    diffculty with getting embedded buttons to work.
    This is a how to on using actionscript in your main time line
    that listens for events for button(s) located inside of a
    movieclip.
    I spent hours trying to figure out why I could not access my
    button that was inside of a movie clip from the main ROOT or
    _level0 of my scene. When I placed the AS inside the movieclip that
    the button was inside of, the button worked but when I put the same
    code, no changes, on the main timeline nothing happened.
    myMovie_mc.myButton_btn.onRelease = function() {
    trace("The Button Works!");
    Your can also use onPress, onRollOver or any of the button
    actions you would if you created the AS on the button itself.
    myMovie_mc.myButton_btn.onRelease = function() {
    function() part of the code can also be function():Void
    First you tell flash where the button is located. Starting
    from the main timeline you start with the name of the movie. This
    is where I had trouble and why my buttons did not work. This part
    of the code is the INSTANCE name NOT the label you named the movie
    that displays in the library.
    CREATE AN INSTANCE NAME on the movie clip. Select the movie,
    in the properties bar you will see a field where you place the
    instance name. I always end the name with _mc, or _btn to tell me
    that it is a movie or a button so when I go back through the AS I
    know what that object is that is being referenced.
    myMovie_mc <-- This is the INSTANCE NAME of the movie clip
    myButton_btn <-- This is the name of the button INSTANCE
    NAME that resides inside the myMovie_mc movie clip
    onRelease <-- This is the event listened for, it could
    also be onPress, onRollOver or any other button events
    = function() <-- This is needed and tells flash that this
    code is treated as a function so that when the event happens, in
    this case onRelease, the code inside the { } is executed. This
    could also be = function():Void
    All the parts before the set to symbol or the = sign needs to
    be seperated with a period, though NOT between the event listened
    for and the set to symbol or = sign.
    myMovie_mc.myButton_btn.onRelease = function():Void
    Put your code here that you want performed when button is
    Released...
    The reason my code didn't work was because I did not give an
    instance name to the movie clip. You must give instance names to
    ANYTHING you call within AS code. Including buttons, MC's, symbols
    etc... or else nothing will happen.
    Now, if you are having same problem I had, the AS worked on
    the same time line level as the button was on but NOT when placed
    in parent or main time line, you now know how to fix it.
    This works in AS2, Flash8 and Flash9. I don't have AS3 yet
    but the code should work in AS3 also.
    Hope this helps someone, I searched for this info in the
    forums and could NOT find it. I stumbled upon my error after many
    hours of trial and error. So next time if I have this problem
    again, a forum search will bring this post up in the results. LOL
    Thanks.

    Nice post. One small addition to this is that you can also
    just specify a function name instead of using "=function() {".
    For example:
    myMovie_mc.myButton_btn.onRelease = myFunction;
    function myFunction():Void
    Put your code here that you want performed when button is
    Released...
    This could be used in a couple of ways. First, the way you
    mentioned in your post. Second, you can use this method to have the
    program simulate a button press (even if the user does not click on
    the button). Since the function will execute even if you just call
    it like: myFunction();
    Just my 2 cents.
    Tim

  • Adding thousands of instances of a movie clip

    I am trying to add around 20,000 instances of a single small
    movie clip (HexTile) from the library into a container Sprite using
    actionscript. The problem is it loads immediately and it loads very
    slowly, so I would like to know if there is a way to preload it?
    The class that adds the movie clip library symbol (World) is not
    the document class, nor is it referenced from the document class. I
    have tried dragging an empty sprite linked to World, and I have
    tried exporting it to other frames as well is preloading it as it's
    own .swf...any suggestions would greatly appreciated! The code
    looks like:

    Hi
    I guess you can one thing. add dummy pre-loader before loop
    and then just hide it after loop ;)

  • Flash crashes on delete movie clip

    I have a movie clip object about 100 frames long places as an
    instance on my main mc timeline. If I try to move it, nothing
    happens; if I try to delete/cut it, it crashes Flash MX 2004 with
    the message "The instruction at "0x0062bcfa" referenced memory at
    "0x00000010". The memory could not be "read"." I've already
    re-installed Flash. Any ideas? I do have a demo of Flash 8 on the
    computer (expired); when I try to uninstall it, I can't.

    Unticking the publish html page in the Publish Settings a
    ppears to solve the issue, though I can find plenty of people with the same problem online and very few solutions

  • Count number of children movie clips?

    I have buttons that create specific movie clips such as a library object named "Clip_1":
    function b_Add_Clip_1(event:MouseEvent):void
    var b:MovieClip = new Clip_1();
    b.name = "Clip_1";
    container.addChild(b);
    I can add many Clip_1's, Clip_2's and so on, by their corresponding buttons.I cannot figure out how to count the number of them that exist on the stage, however.
    I would like the number of Clip_1 instances to display in a text field.
    For example: If there are 20 on the stage, the text field should display 20, if one is removed, it should display 19.
    I would be grateful for any helpful hints, thank you.

    That seems to make sense, too. I will analyze it closely and give it a try, thanks!
    SInce then, I've been trying another approach, I'd really appreciate opinions on it.
    Setup:
    In each clip variety (Clip_1, Clip_2, etc)  there is a common instance called 'control' which performs functions such as drag, rotate and removeChild by referencing its parent.
    For example, In control I have code that gets its parent name and displays it in a text field at the root, on hover: Object(root).part_txt.text = Object(this).parent.name;
    What I am trying currently:
    In control's first frame I place code that grabs the current count in the corresponding count field (based on its parent's name) and adds 1 to it, simply by the instance appearing on the stage.
    I am trying to do that by this code:
    // Turn the instance name, example: "Clip_1" into a varable "this_part":
    var this_part = Object(this).parent.name;
    // The count fields are named Clip_1_count, Clip_2_count, etc, taking the value of that field and making it a variabe "c_this_part"
    var c_this_part = Number(Object(root[this_part + "_count"].text));
    // Now adding 1 to the count field value
    var v_this_part:Number = c_this_part+1;
    // Then update the count field with the new value
    Object(root[this_part + "_count"].text) = String(v_this_part);
    If I can get that to work, I can add a similar function to the delete function that subtracts from the count field.
    The problem is, Object(root[this_part + "_count"].text) = String(v_this_part); produces this error: 1105: Target of assignment must be a reference value.
    Am I missing something obvious? Or is this a fruitless tactic?
    Thanks again for your time.

  • How do i reference a movie clip instance name from inside child movie clips.

    I have a label I am referencing form a movie clip inside the movie clip which contains the "label_2."
    Here is the code I used:
    MovieClip(parent.parent).gotoAndPlay("return_2");
    Now I need to reference a instance name of a movie clip in side the same scene.
    What would the code be?

    You should probably start by reading the docs and/or google:
    http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/events/Event.html
    http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9 b90204-7fca.html
    http://www.google.com/search?hl=en&q=AS3+events
    Once you got the basics down, look into creating/using your own custom events:
    http://www.google.com/search?hl=en&q=AS3++custom+events
    http://www.adobe.com/devnet/actionscript/articles/event_handling_as3.html
    Event dispatching and event handling is one of the most important things about ActionScript. The sooner you get into them, the better.

  • Stopping and Playing a series of movie clips

    I am looking to make a showreel of a series of movie clips that reside on a single frame each in the main timeline.
    I have been searching google and Adobe forums for a solution with Action Script 3 but have yet to find one that works as described. I feel as though the scripts I am finding are partial and not complete examples because the script fails due to functions/variables/events/etc being duplicated or not found/referenced.
    What I need to happen is:
    movieClipA plays
         when movieClipA finishes
              goto MovieClipB
    movieClipB plays
         when movieClipA finishes
              goto MovieClipC
    movieClipC plays
         when movieClipC finishes
              goto MovieClipA (I am having most trouble with the loop back)
    Most of the time when the script works in the various ways I have scripted it, it will either flicker between the frames or play the first one then loops the seconds one or play both but not loop back. And sometimes (when I have used an event listener) it crashes the preview probably due to an infinate loop in the syntax I guess.
    It would be very helpful if you could break up the code into where each script is required to be keyed.
    Any help would be greatly appreciated!

    Figures.. I just found the post on the forums that answered my question.
    I have on the last frame of each MC - MovieClip(parent).nextFrame();
    Then in the main timeline I have - stop();
    I then have a frame after the last MC which says gotoAndPlay(1);
    This works
    If you would still like to show me another solution, atleast then I know two ways how to do the same thing

  • Assigning names to movie clips in loop

    hey, sorry if this is double post...
    im trying to run a loop and assign all my new movie clips
    with different names. i have tried .name and ._name they dont seem
    to be working... any help is appreciated.
    for (var i = 1; i<=5; i++) {
    imageName = new ImageMovie();
    this.addChild(imageName);
    so how do i make imageName something like imageName1,
    imageName2, ...

    Depends on what you mean by "name". If you mean the actual
    Object Name (), I don't think you'd like to rename that anyhow, but
    changing the property "name" of the Object is easy:
    for(var i=1; 1<=5; i++){
    image = new ImageMovie();
    image.name = "imageName" + i;
    this.addChild(image);
    Now you can access your 5 imageMovie instances by referencing
    their name property, as in getChildByName(imageName1);
    Any help?

Maybe you are looking for

  • Cannot open iTunes on Windows 7

    I was getting an error when I tried to open iTunes that said "iTunes has stopped working" and it asked me if I wanted to send the problem to Microsoft. The error appeared after about a minute after clicking to try to open it. I am running Windows 7,

  • My iPhone shows up as a portable device with a blue camera logo instead of the Apple device/model with the appropriate device image (mine used to show a Black iPhone 5s)

    Hi, I've recently done a complete format of my OS and reinstalled it. I reinstalled all the drivers etc. such as the USB drivers/controllers and the new iTunes12. To confirm I have tried everything from this article (iPhone, iPad, or iPod not recogni

  • Currency format in the ALV display.

    Hi. Im trying to display values of MBEW-stprs in the ALV report But the problem is the format is different for different countries, for ex; Korea has no decimal places and us dollar has 2 decimals. how can i display the currency with respect to the c

  • Opening and using the second opitical drive?

    Okay, I have a dummy question about my new Mac Pro. I got it with two optical super drives. I'm burning one disc right now, but I need to know how I can burn on the second drive. I'm thinking if I click on the eject button to open the second drive, t

  • [OBIEE - Answers] Error on filter

    Hi all, I have a problem when i try to specify a filter on an union of three query in answer. My query is accessing an Essbase cube My filter is : RIGHT(Time.Year,4) equal to @{pv_YEA} pv_YEA is my presentation variable with value "2010" values of Ti