Importing AI Layer Names as Movie Clip Names?

Hi all,
We've got an Illustrator file with something over 1,000 layers. We're trying to import this into Flash and keep the layer names intact, such that they become the names of the movie clips that are imported for each layer and can be used programmatically. (It is a diagram and arrows, boxes, etc all have callout names that will eventually allow them to link to a database.)
As near as I can tell, the Import dialog will NOT pass this info across between the two parts of the dialog. Anyone have a magical suggestion for how to make it do so? We're using Flash CS4, but I have access to CS5 too if that will help.
Thanks in advance,
Eric.

I give up.
Dear Adobe/Macromedia engineer in charge of the Illustrator Import Filter. Please DIAF. All you had to do was copy the damned layer name across the panel into the Instance name field, but that would make it too easy!
So, I figured I'd script around it. Wrote an Applescript that changes the color and transparency of every single item in the entire document to be unique and generates a text file annotating what was what. Then I tried to import it into Flash so that I could use that text file to reapply names to everything. IMMEDIATELY stymied though, because the effing Illustrator->Flash importer is inaccurate as HELL about what transparency number actually gets imported. I needed to use 0.1% transparency increments to be able to accomodate enough groups. As near as I can tell Flash barely supports 1% increments accurately though! WHAT THE HELL?!
Anyways, sorry for venting, but the experience is soooo typical of the crap you run into trying to get anything done in Flash...
Argh.

Similar Messages

  • Is There An Extension that Renames Layers Based on Movie Clip Names of Files

    Hi all,
    I was wondering if anyone knew of an extension that could
    rename layers on the main time line based on the movie clip names
    that are found on the time line. I have a client file that is
    absolutely huge but all the layers are just named Layer followed by
    random numbers.
    I have seen extensions that clean up the library but never
    one that cleans layer names.

    fcastro75,
    > Sounds great! I was actually thinking about this over
    the
    > weekend and asking a few fellow flashers what they
    though.
    > I think instance names should have the highest
    importance. [...]
    If you're still watching this thread, I have a few more
    questions for
    you. :) I finally have some time to play with this script,
    and there's a
    twist I didn't think of earlier.
    Here's how JSFL works in regard to your particular aim:
    a) Get the current timeline.
    b) Get the layers of that timeline.
    c) Get the *frames* inside each layer.
    d) Get the elements inside each frame.
    The twist is C, and it adds considerable complexity to this
    script. You
    might have a layer with 100 frames on it, and each frame has
    a different mc
    (or graphic, or text field, etc.) on it. What on earth should
    this layer be
    named? In your previous post, you suggested this:
    > Layers that have multiple instances should read
    multi-item.
    That may well mean that feasibly half of your layers say
    "multi-item" in
    then, even if a given layer only has two separate items on it
    (one graphic
    symbol spanned from frames 50 to 80, and another graphic
    symbol spanned from
    frames 200 to 550).
    Even if we were to increment the names of these, you could
    easily get 30
    layers in a row named "multi-item (1)", "multi-item (2)",
    "multi-item (3)",
    and so on. Seems to me like that wouldn't be any more helpful
    than what you
    have now.
    One approach -- much easier to program, as it happens --
    would be to
    simply stop at the first frame in a layer that has content at
    all, and name
    the layer after that.
    e.g.
    "instanceName" (moveiclip) [1]
    ... where "instanceName" is the element's instance name,
    (movieclip) is the
    element's type, and [1] is the occurence of that element. If
    that layer
    contains any additional content -- either on that frame, or
    subsequent
    frames, we could add that "multi-item" phrase, like this:
    "instanceName" (moveiclip) [1] multi-item
    This way, in cases where the designer only used on element
    in a layer,
    you'd get a meaningful indication of that. In cases where the
    designer used
    several, you'd at least get an indication of the first one,
    with a hint that
    others exist.
    Whatcha think?
    David Stiller
    Adobe Community Expert
    Dev blog,
    http://www.quip.net/blog/
    "Luck is the residue of good design."

  • How to obtain instance name of Movie Clip?

    Hello!
    Is there a way to get the instance name of a move clip once it's on the stage?  In my dress up game, I need to know which items are on the doll in order to keep them visible.  My drag and drop feature uses an array and currentTarget:
    var dragArray:Array = [Doll.Drawers.Dress1, Doll.Drawers.Dress2, Doll.Drawers.Dress3, Doll.Drawers.Dress4];
              for(var i:int = 0; i < dragArray.length; i++)
                        dragArray[i].buttonMode = true;
                        dragArray[i].addEventListener(MouseEvent.MOUSE_DOWN, item_onMouseDown);
                        dragArray[i].addEventListener(MouseEvent.MOUSE_UP, item_onMouseUp);
    function item_onMouseDown(event:MouseEvent):void
                   var clip:MovieClip = MovieClip(event.currentTarget);
                   clip.startDrag();
    function item_onMouseUp(event:MouseEvent):void
                   var clip:MovieClip = MovieClip(event.currentTarget);
                   clip.stopDrag();
                   if(clip.hitTestObject(Doll.Skins))
                                 //Here's where the problem starts!   ----------------------------------------------  //
                                  trace("It's on the doll!");
    It can successfully run this code.  However, instead of tracing "It's on the doll!", I'd like to turn the currentTarget into it's instance name, which should be "Doll.Drawers.Dress1" etc... and then store that name in an array.
    How would I do this?
    I've looked into e.target.name, but I keep getting errors...

    use the name property of clip (if that's the movieclip whose name you want):
    var dragArray:Array = [Doll.Drawers.Dress1, Doll.Drawers.Dress2, Doll.Drawers.Dress3, Doll.Drawers.Dress4];
              for(var i:int = 0; i < dragArray.length; i++)
                        dragArray[i].buttonMode = true;
                        dragArray[i].addEventListener(MouseEvent.MOUSE_DOWN, item_onMouseDown);
                        dragArray[i].addEventListener(MouseEvent.MOUSE_UP, item_onMouseUp);
    function item_onMouseDown(event:MouseEvent):void
                   var clip:MovieClip = MovieClip(event.currentTarget);
                   clip.startDrag();
    function item_onMouseUp(event:MouseEvent):void
                   var clip:MovieClip = MovieClip(event.currentTarget);
                   clip.stopDrag();
                   if(clip.hitTestObject(Doll.Skins))
                                 //Here's where the problem starts!   ----------------------------------------------  //
                                  trace(clip.name);  // but that won't be Doll.Drawers.Dress1.  it might be Dress1.

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

  • Changing imported image with layers to movie clip

    Yes I have imported an .ai file into flash with several
    layers on it. When I then converted it to a movie symbol it
    flattened all the layers down. How can I convert it and keep the
    layers editable?

    They are editable, just within the movie clip. Double click
    it either on the stage or in the library.

  • Changing clip name behavior for duplicate clips

    Suppose I have one duplicate clip that I have copied into two bins, like so:
    -- Sunday's clips bin
              - clip_name_one
    and
    -- Flowers bin
              - clip_name_one
    If I change the name of one, I expect it to change the name of the other also, since it is the same clip, just placed in two different places (not two separate files).  Instead it only changes in one place, like so:
    -- Sunday's clips bin
              - clip_name_one
    and
    -- Flowers bin
              - clip_name_one_tulip
    Is this intentional behavior? I can't imagine how confusing this will be for logging when I make duplicates in multiple places for organizational purposes. I may even end up with the same clip with multiple names. The same is true for the metadata associated with the clip - if I add a comment in the comment field, it does not propogate. Markers, however, DO propogate to both, which is exactly as I would expect. Why not the metadata?
    Is there a way around this (short of never duplicating clips)?

    I agree, Premiere Pro is a bit weird in what it does and doesn't carry across duplicate clips. For instance, you can interpret the frame rate for a duplicate different than the other version of it. But if you go to timecode and enter a changed start timecode it effects both instances. I get why you would want to sync both name and metadata, but I also see benefits to not syncing it. Either way, I agree the option should be there. There also should be an option like fcp7 has, to rename a clip based on file name, or rename a file name based on clip name (but there isn't).
    That said, instead of creating duplicates of the clip in different organizational bins, you could create custom metadata columns. Therefore creating sort of a virtual bin.
    You could do that by going to the top right of the project panel and clicking on the little down arrow. Then go to metadata display (while in list view). Then you can click on Add Property in the Premiere Pro Project Metadata area. Then you could do a custom property, decide whether you want integer, real, text or boolean. You'd probably want text. So you could choose text and name it Flower. Then you could hit ok. Go back to list view, and type in flower
    Then in your project panel search box, type in flower and find all clips using it. A work around for sure, but may achieve what you want.
    P.S. It would be much better if you could create a boolean field and just search by the word flower and everything checked would come up in the search. Unfortunately the search is a bit stupid when it comes to this. So if you search flower with a bloolean field, nothing will come up! You have to search true or false, and then ANY checked box will show. Quite dumb! Definite feature request!

  • Import Movie clips between iPhoto libraries.

    I need to import iPhoto movie clips from one iPhoto library to another.  I was successful to share the library and import the photos but the movie clips taken with my iPhone do not show up to import.  Please help.

    There is no way to share movie clips.
    Either export them to the Finder and then import them to the other Library or use iPhoto Library Manager

  • Import home movie clips from DVD

    Hi all -
    I've been trying to wrap my non-computer brain around the process of importing a previously burned home movie clip from DVD back into iMovie so I can add to it. (I messed up the first burn, but because of limited space, I deleted the original clip.)
    I'd be happy to get it back to tape on my camcorder if that is the only way to do it, but I fear losing quality.
    I've downloaded Mac the Ripper and Streamclip, but I don't want to pay extra money for any software (I'm a poor, starving student mom).
    Can anyone help out?
    Christine.

    Your burned DVD uses MPEG-2 file format. You'll need more software:
    MPEG Streamclip (free).
    Apple's MPEG-2 PLayback Component ($20).
    Use Streamclip to open the DVD contents and export to DV Stream (huge file). Use the .dv file in iMovie.

  • Rollover buttons that play a movie clip.

    Hello,
       I am new to Flash and I am trying to accomplish a simulation such as this example, http://www.its-about-time.com/investinesart/coalplantvirtualtour.swf. I have all of my movie clips done, but how do I tell a rollover button to play a specific movie clip? I also want to have all the movie clips to play simultaneously via a rollover button as shown in the example. I've attached a captured image of my timeline, if that helps. I've tried everything so far, but nothing is working! What is the simplest way of doing this?
    I have this inside one of the movie clips (mc_2) in a seperate layer under - (actions)
    RO_btn.onRollover = function(){
    mc_2.play();
    On the main timeline I have an actions layer with this:
    stop();
    Thinking that this may stop all of my movie clips but it doesn't.
    Should I make an actions layer in each movie clip with this syntax huh? stop();?
    I'm frustrated!!
    Thanks, if you can help!
    MG

    Hi,
    I have made something that you are looking for.
    It will be of help to you.
    basically you will have to create a few movie clips namely:
    2 buttons: (name them a_btn, b_btn, c_btn, d_btn, e_btn)
    3 movie clips (I am taking example image1_mc, image2_mc, image3_mc)
    in each of these movieclips.place 2 frames and on second frame put your movieclip(one in one).on both the frames put stop()
    now click on a_btn and write this script
    on (rollOver) {
    _root.image1_mc.gotoAndPlay(2);
    _root.image2_mc.gotoAndPlay(2);
    _root.image3_mc.gotoAndPlay(2);
    on (rollOut) {
        _root.image1_mc.gotoAndPlay(1);
        _root.image2_mc.gotoAndPlay(1);
        _root.image3_mc.gotoAndPlay(1);
    with this all 3 animations will work simultaneously. if you need to run any one of the movieclips at a time the you can address that mc in particular
    .Say if you want only 1 mc to move at a time then put this on  btn 2
    on (rollOver) {
    _root.image1_mc.gotoAndPlay(2);
    on (rollOut) {
        _root.image1_mc.gotoAndPlay(1);
    .Dont forget to give proper instance names to movieclips.(they are in properties panel.)
    Cheers!

  • Changing depths of movie clips with button clicks

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

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

  • How to unload a movie clip within a movie clip.

    Hi all,
    I am trying to unload a movie clip that is on a layer in a
    movie clip. After clicking on a button, I would like the movie to
    go back to the previous menu without playing a couple of movie
    clips that's in the main movie clip.
    So at the end of my movie clip I have:
    _parent.gotoAndPlay("resources"); // resources is the frame
    name in the main movie clip where I would like the movie to restart
    from
    _parent.vhost_mc.unloadMovie("vhost_mc"); //vhost_mc is a
    movie clip in the main movie clip that I want to unload
    _parent.videoScreen_mc.unloadMovie();
    But the videoScreen_mc doesn't unload. The main movie clip
    starts with the videoScreen and I've actually deleted the frames of
    videoScreen_mc where the "resources" frame starts, but still it
    appears.
    I've even tried _parent.videoScreen_mc._visible = false; but
    nothing works! I've tried createEmptyMovieClip, but since the
    videoScreen_mc is on the main timeline, I don't think it works.
    I've even tried putting this function on the "resources" frame:
    onEnterFrame = function() {
    play();
    vhost_mc.unloadMovie("vhost_mc");
    vhost_mc.removeMovieClip();
    this.videoScreen_mc.unloadMovie();
    this.videoScreen_mc.removeMovieClip();
    this.mask._visible = false;
    But when I do this, the play button loops starting at the
    "resources" frame.
    Essentially I would like the main movie clip to play without
    certain movie clips that's included within the main movie clip.
    I hope I'm making sense. Please help, I've been at this for
    days!

    Olá Felipe, tudo bem com você?
    In order to unload content loaded into a Loader object you can use either the unload() method or the unloadAndStop() method. The difference between them is that unloadAndStop() will unload the loaded SWF and try to stop executing any code that it was running including animations, sound and event listeners.
    If you wanto to call the unload() or unloadAndStop() methods from the loaded SWF you can use its loaderInfo.loader property to reference the Loader object that loaded it.
    It could be someting like this:
    this.closeButton.addEventListener(MouseEvent.CLICK, this.handleClose);
    protected function handleClose(event:MoueEvent):void {
         this.loaderInfo.loader.unloadAndStop();
    You can pass a Boolean parameter to unloadAndStop() to indicate if Flash's garbage collector should be run ont the unloaded SWF in order to free up memory. Considering the size of your SWFs, this could be a good option. The downside is that there is a performance penalty and in my professional experience, CPU is still a resource that is more scarce than memory, so use with care.
    Hope this helps.
    Abraço,
    Rui

  • Movie Clips Trouble

    Hello,
    Just wondering if anyone can help me.
    I have a series of movie clips, movieClip1_mc, movieClip2_mc,
    movieClip3_mc.............etc. and i have another series of
    dragable movie clips, drag1_mc, drag2_mc,
    drag3_mc...............etc.
    I need to code my action script so that when drag1_mc is
    droped within movieClip1_mc or 2 or 3 etc that the name of the
    movie clip which is the target (ie movieClip1_mc) to be put into a
    variable, from there i can then work with that variable.
    Any ideas, i hope that makes sense :)
    Many thanks any help is greatly apppreciated :-)
    Cheers
    Jude

    hello,
    Okay so ive set up my array with all of the movie clips names
    inside, this array is called 'mcArray'
    Than i set up a simple loop but i dont know if this is
    correct:
    for( var i= 0; i<=mcArray.length; i++){
    now inside this i am required to put the hit test in arent i?
    So far i put this in
    drag1_mc.hitTest(i);
    This is a total stab in the dark at this so im sorry if im
    wrong, lol however this bring up false for every field in the array
    when i trace it, is this because my code is wrong or because my
    movie clips are not in the same place, they start off on the same
    level but drag1_mc goes down a few more levels than movieClip_mc,
    could this be my problem??
    Many thanks
    Cheers

  • How to play the main timeline after a movie clip is finished playing.

    Ok so here is the problem, I have the main time line with three layers: My actions layer, a music layer, and the movie clip layer.
    The movie clip is an actionscript movie which calls images from an external XML file and shows them as a slideshow. What i need to do is after the last image plays, stop the movie and move the main timeline to the next scene of the main movie. Everything logical in my brain is not working, and it may be that I have been staring at this project for too long but for the life of me i can't make this work.
    Any help or input would be greatly appreciated!
    Thanks in advance.
    Meghan

    better yet, here is the whole code. With your suggestion entered...
    import flash.display.BitmapData;
    import gs.*;
    import gs.easing.*;
    import gs.plugins.*;
    TweenPlugin.activate([BlurFilterPlugin]);
    OverwriteManager.init();
    var xml:XML = new XML();
    xml.ignoreWhite = true;
    _root.xmlPath == undefined ? xml.load("jake.xml") : xml.load(_root.xmlPath);
    //when xml is loaded
    xml.onLoad = function(succes:Boolean) {
        if (succes) {
            //position the slideshow. remember size.
            __width = Number(xml.firstChild.attributes.width);
            __height = Number(xml.firstChild.attributes.height);
            mcMask._width = mcBlack._width=mcHyper._width=__width;
            mcMask._height = mcBlack._height=mcHyper._height=__height;
            //preloader
            mcPreloader._x = __width/2;
            mcPreloader._y = __height/2;
            (new Color(mcPreloader).setRGB(Number(xml.firstChild.attributes.preloaderColor)));
            //buttons
            var buttonLoader:MovieClipLoader = new MovieClipLoader();
            var buttonListener:Object = new Object();
            buttonListener.onLoadInit = function(cButton:MovieClip) {
                if (cButton._parent == btnNext) {
                    cButton._parent._x = __width-cButton._width;
                } else if (cButton._parent == btnPrev) {
                    cButton._parent._x = 0;
                } else {
                    cButton._parent._x = (__width-cButton._width)/2;
                cButton._parent._y = (__height-cButton._height)/2;
            buttonLoader.addListener(buttonListener);
            buttonLoader.loadClip(xml.firstChild.attributes.prevButton,btnPrev.holder);
            buttonLoader.loadClip(xml.firstChild.attributes.nextButton,btnNext.holder);
            buttonLoader.loadClip(xml.firstChild.attributes.playButton,btnPlay.holder);
            buttonLoader.loadClip(xml.firstChild.attributes.pauseButton,btnPause.holder);
            xml.firstChild.attributes.slideshowOn == "true" ? [_slideshow=true, btnPlay._visible=false] : [_slideshow=false, btnPause._visible=false];
            for (var i:Number = 0; i<xml.firstChild.childNodes.length; i++) {
                //create empty movieclip for each picture. create mask movieclip for each picture. save transition and ken burns settings for each picture. save other properties for each picture.
                mcTemp.createEmptyMovieClip("mcPhoto"+i,mcTemp.getNextHighestDepth());
                mcHolder.createEmptyMovieClip("mcPhoto"+i,mcHolder.getNextHighestDepth());
                mcHolder["mcPhoto"+i].createEmptyMovieClip("photo",mcHolder["mcPhoto"+i].getNextHighestDe pth());
                //attach text clip and set it up
                mcHolder.attachMovie("square2","mcBack",mcHolder.getNextHighestDepth());
                mcText.attachMovie("text","text"+i,mcText.getNextHighestDepth());
                mcText["text"+i].mcText._alpha = mcBack._alpha=0;
                mcBack._width = mcText["text"+i].mcText._width=__width;
                mcText["text"+i].mcText.autoSize = true;
                mcBack._height = 0;
                mcBack._y = __height;
                (new Color(mcBack).setRGB(Number(xml.firstChild.attributes.textBackColor)));
                mcHolder["mcPhoto"+i].transition = Number(xml.firstChild.childNodes[i].attributes.transition);
                var burns:Array = String(xml.firstChild.childNodes[i].attributes.kenBurns).split(";");
                mcHolder["mcPhoto"+i].burns = burns;
                mcHolder["mcPhoto"+i].time = Number(xml.firstChild.childNodes[i].attributes.time);
                mcHolder["mcPhoto"+i].src = String(xml.firstChild.childNodes[i].attributes.src);
                mcHolder["mcPhoto"+i].txt = String(xml.firstChild.childNodes[i].firstChild.nodeValue);
                mcHolder["mcPhoto"+i].url = String(xml.firstChild.childNodes[i].attributes.url);
                mcHolder["mcPhoto"+i].target = String(xml.firstChild.childNodes[i].attributes.target);
                //handle loading process. create loader objects. start "intelligent loading". set methods and actions for new newly loaded pictures.
                var photoLoader:MovieClipLoader = new MovieClipLoader();
                var photoListener:Object = new Object();
                photoListener.onLoadInit = function(cPhoto:MovieClip) {
                    //transform image to bitmap
                    cPhoto._visible = false;
                    var tempBitmap:BitmapData = new BitmapData(cPhoto._width, cPhoto._height);
                    tempBitmap.draw(cPhoto);
                    var cPhoto2:Object = mcHolder["mcPhoto"+_loaded].photo;
                    cPhoto2.attachBitmap(tempBitmap,1,"auto",true);
                    photoLoader.unloadClip(cPhoto);
                    removeMovieClip(cPhoto);
                    cPhoto2._parent._visible = false;
                    //remember original size
                    cPhoto2._parent.width2 = cPhoto2._parent._width;
                    cPhoto2._parent.height2 = cPhoto2._parent._height;
                    cPhoto2._alpha = 0;
                    _loaded++;
                    cPhoto2._parent.loaded = true;
                    if (_loaded<xml.firstChild.childNodes.length) {
                        //load next picture
                        photoLoader.loadClip(mcHolder["mcPhoto"+_loaded].src,mcTemp["mcPhoto"+_loaded]);
                    if (_loaded == _index+1) {
                        //show this picture
                        showPicture(cPhoto2._parent);
                photoLoader.addListener(photoListener);
            photoLoader.loadClip(mcHolder.mcPhoto0.src,mcTemp.mcPhoto0);
    //function that changes to the next photo(slideshow feature)
    function nextPhoto() {
        _index++;
        if (_index == xml.firstChild.childNodes.length) {
        //if picture is loaded, just show it. if not, wait until it loads                                                                           
        if (mcHolder["mcPhoto"+_index].loaded) {
            showPicture(mcHolder["mcPhoto"+_index]);
        } else {
            TweenLite.to(mcPreloader,.5,{_alpha:0});
            TweenLite.to(mcBlack,.5,{_alpha:100,onComplete:completeF});
    function completeF(){
    _root.gotoAndPlay("frame1_scene2");
    //function that changes to the previous photo
    function prevPhoto() {
        _index--;
        if (_index == -1) {
            _index = xml.firstChild.childNodes.length-1;
        //if picture is loaded, just show it. if not, wait until it loads                                                                           
        if (mcHolder["mcPhoto"+_index].loaded) {
            showPicture(mcHolder["mcPhoto"+_index]);
        } else {
            TweenLite.to(mcPreloader,.5,{_alpha:100});
            TweenLite.to(mcBlack,.5,{_alpha:80});
    //buttons - roll overs
    btnNext.onRollOver = btnPrev.onRollOver=btnPause.onRollOver=btnPlay.onRollOver=function () {
        TweenLite.to(this,1,{_alpha:70});
    btnNext.onRollOut = btnPrev.onRollOut=btnPause.onRollOut=btnPlay.onRollOut=btnNext.onReleaseOutside=btnPrev.o nReleaseOutside=btnPause.onReleaseOutside=btnPlay.onReleaseOutside=function () {
        TweenLite.to(this,1,{_alpha:100});
    //buttons - next
    btnNext.onPress = function() {
        if (!_transition) {
            clearTimeout(nextT);
            nextPhoto();
        } else {
            clearTimeout(nextT);
            nextT = setTimeout(nextPhoto, 500);
    //buttons - previous
    btnPrev.onPress = function() {
        if (!_transition) {
            clearTimeout(nextT);
            prevPhoto();
        } else {
            clearTimeout(nextT);
            nextT = setTimeout(prevPhoto, 500);
    //buttons - play
    btnPlay.onPress = function() {
        switchVisible(btnPlay);
        switchVisible(btnPause);
        _slideshow = true;
        if (!_transition) {
            clearTimeout(nextT);
            nextPhoto();
        } else {
            clearTimeout(nextT);
            nextT = setTimeout(nextPhoto, 500);
    //buttons - pause
    btnPause.onPress = function() {
        switchVisible(btnPlay);
        switchVisible(btnPause);
        _slideshow = false;
        clearTimeout(nextT);
    //function that animates text(html for each picture)
    function inText(cPhoto:Object) {
        if (cPhoto.txt != "undefined") {
            mcText["text"+_index].mcText.htmlText = cPhoto.txt;
            mcText["text"+_index].mcText._y = mcBack._y-mcText["text"+_index].mcText._height-4;
            TweenMax.to(mcText["text"+_index].mcText,0,{blurFilter:{blurX:15, blurY:15, quality:1}});
            TweenMax.to(mcText["text"+_index].mcText,Number(xml.firstChild.attributes.textSpeed),{blu rFilter:{blurX:0, blurY:0}, _alpha:100});
            TweenLite.to(mcBack,Number(xml.firstChild.attributes.textSpeed),{_alpha:Number(xml.firstC hild.attributes.textBackOpacity), _height:mcText["text"+_index].mcText._height+7});
        } else {
            mcText["text"+_index].mcText.htmlText = "";
            TweenLite.to(mcBack,Number(xml.firstChild.attributes.textSpeed),{_alpha:Number(xml.firstC hild.attributes.textBackOpacity), _height:0});
    function outText(cPhoto:Object) {
        TweenLite.to(mcBack,.5,{_alpha:0});
        TweenLite.to(mcText["text"+_index2].mcText,.5,{_alpha:0});
    //function that applies the ken burns effect to a specific photo
    function kenBurns(cPhoto:Object) {
        //reset size and position
        cPhoto.photo._xscale = cPhoto.photo._yscale=Number(cPhoto.burns[0]);
        cPhoto.photo._x = returnPosition(cPhoto.burns[2], cPhoto.photo._width, cPhoto.photo._height, mcMask._width, mcMask._height).__x;
        cPhoto.photo._y = returnPosition(cPhoto.burns[2], cPhoto.photo._width, cPhoto.photo._height, mcMask._width, mcMask._height).__y;
        //start effect
        TweenLite.to(cPhoto.photo,cPhoto.transition+Number(cPhoto.time)+1,{_xscale:Number(cPhoto. burns[1]), _yscale:Number(cPhoto.burns[1]), _x:returnPosition(cPhoto.burns[3], cPhoto.width2, cPhoto.height2, mcMask._width, mcMask._height).__x, _y:returnPosition(cPhoto.burns[3], cPhoto.width2, cPhoto.height2, mcMask._width, mcMask._height).__y, ease:Linear.easeNone});
    //function that shows a picture(transition function)
    function showPicture(cPhoto:Object) {
        for (var i:Number = 0; i<xml.firstChild.childNodes.length; i++) {
            if (i == _index || i == _index2) {
                mcHolder["mcPhoto"+i]._visible = true;
            }else{
                mcHolder["mcPhoto"+i]._visible = false;
        cPhoto.swapDepths(mcHolder.getNextHighestDepth());
        setTimeout(hideOld,cPhoto.transition*1000,mcHolder["mcPhoto"+_index2]);
        //text
        outText(mcHolder["mcPhoto"+_index2]);
        _index2 = _index;
        inText(cPhoto);
        kenBurns(cPhoto);
        TweenLite.to(mcPreloader,.5,{_alpha:0});
        TweenLite.to(mcBlack,.5,{_alpha:0});
        //transition variable
        _transition = true;
        clearTimeout(transT);
        transT = setTimeout(switchTransition, cPhoto.transition*1000);
        cPhoto.photo._alpha = 0;
        TweenLite.to(cPhoto.photo,cPhoto.transition,{_alpha:100});
        if (_slideshow) {
            //if slideshow is on
            nextT = setTimeout(nextPhoto, (cPhoto.transition+cPhoto.time)*1000);
    function hideOld(what:Object){
    //hyperlinks
    mcHyper.useHandCursor = true;
    mcHyper.onPress = function() {
        if (mcHolder["mcPhoto"+_index].url != "undefined") {
            getURL(mcHolder["mcPhoto"+_index].url, mcHolder["mcPhoto"+_index].target);
    //function that returns a number position from a given "compass position"(for the ken burns effect)
    function returnPosition(pos:String, __width:Number, __height:Number, __width2:Number, __height2:Number):Object {
        var returnObj:Object = new Object();
        switch (pos) {
            case "TL" :
                returnObj.__x = 0;
                returnObj.__y = 0;
                break;
            case "TC" :
                returnObj.__x = -(__width-__width2)/2;
                returnObj.__y = 0;
                break;
            case "TR" :
                returnObj.__x = -(__width-__width2);
                returnObj.__y = 0;
                break;
            case "ML" :
                returnObj.__x = 0;
                returnObj.__y = -(__height-__height2)/2;
                break;
            case "MC" :
                returnObj.__x = -(__width-__width2)/2;
                returnObj.__y = -(__height-__height2)/2;
                break;
            case "MR" :
                returnObj.__x = -(__width-__width2);
                returnObj.__y = -(__height-__height2)/2;
                break;
            case "BL" :
                returnObj.__x = 0;
                returnObj.__y = -(__height-__height2);
                break;
            case "BC" :
                returnObj.__x = -(__width-__width2)/2;
                returnObj.__y = -(__height-__height2);
                break;
            case "BR" :
                returnObj.__x = -(__width-__width2);
                returnObj.__y = -(__height-__height2);
                break;
        return returnObj;
    function switchTransition() {
        _transition == true ? _transition=false : _transition=true;
    function switchVisible(obj:Object) {
        obj._visible == true ? obj._visible=false : obj._visible=true;
    mcTemp._x = -10000;
    //mouse testing
    var mouse_dx:Number = _xmouse;
    var mouse_dy:Number = _ymouse;
    var mouseSpeed:Number = 1;
    function checkPosition(Void):Void {
        if (_xmouse<mouseSpeed || _xmouse>(Stage.width-mouseSpeed) || _ymouse<mouseSpeed || _ymouse>(Stage.height-mouseSpeed)) {
            //mouse outside - hide buttons
            TweenLite.to(btnPrev,.5,{_alpha:0});
            TweenLite.to(btnNext,.5,{_alpha:0});
            TweenLite.to(btnPlay,.5,{_alpha:0});
            TweenLite.to(btnPause,.5,{_alpha:0});
        } else {
            //mouse inside
            TweenLite.to(btnPrev,.5,{_alpha:100});
            TweenLite.to(btnNext,.5,{_alpha:100});
            TweenLite.to(btnPlay,.5,{_alpha:100});
            TweenLite.to(btnPause,.5,{_alpha:100});
    checkPosition(Void);
    var mouseListener:Object = new Object();
    mouseListener.onMouseMove = function():Void  {
        mouse_dx = Math.abs(mouse_dx-_xmouse);
        mouse_dy = Math.abs(mouse_dy-_ymouse);
        mouseSpeed = mouse_dx>mouse_dy ? mouse_dx : mouse_dy;
        mouseSpeed += 1;
        checkPosition(Void);
        mouse_dx = _xmouse;
        mouse_dy = _ymouse;
    Mouse.addListener(mouseListener);
    //global variables
    var this2:Object = this;
    var __width:Number;
    var __height:Number;
    var _index:Number = 0;
    var _index2:Number = -1;
    var _loaded:Number = 0;
    var nextT:Number;
    var transT:Number;
    var _slideshow:Boolean = true;
    var _transition:Boolean = false;
    Stage.scaleMode = "noScale";
    Stage.showMenu = false;
    Stage.align = "TL";

  • Simple play movie clip rollover

    Hi all, I am losing it on this one. I have created a simple
    movie clip called "web templates movie" I have a simple text button
    to bring the movie to life.
    The button has a rollover action on it but will not for the
    life of me work.
    What actionscript do I need to put on the button to play the
    movie clip on my site? When I rollover it now it refreshes my main
    page, no matter what I name the movie clip within the script to
    play.
    I just want to roll over the text button and bring up the
    movie clip.
    ?

    Ned
    thanks for the reply.
    I have tried using this code before, it was actually what I had seen dotted around various forums. It still wont work though? I dont know if it is the way I have the timeline set up, or maybe the movieclip?
    I have attached the .fla file to clear things up.
    The movie clip named Atkins logo is on frame 1. Nothing else is on frame 1 in the main timeline. Then Frame 2 begins the section called 'intro'. I would like the movie clip to play through and then move to frame 2 of the main timeline, which is frame 1 of the 'intro' section.
    I have tried putting the script in you have suggested but it does not seem to work. When I test the movie the logo does not even begin to play?

  • How to play sounds depending on a value in a movie clip?

    I have a movie clip layer (in main timeline) named "options_mc" inside of it; it contains a dynamic text field (onoff_txt) that changes to 0 or 100 when a button (sound_btn) is clicked. If the value is 100, then sounds should play..if it is 0, sounds should not play. On a different layer in a movie clip on the main timeline, I have the sound channel "tchannel" I added a function in that same layer which goes like this:
    CheckSound();
    function CheckSound():void
    if(options_mc.onoff_txt == 100)
    tchannel = theme.play(0,9999);
    else if(options_mc.onoff_txt == 0)
    trace("noplay");
    The sound does not play at all, nor does a trace statement appear. What is wrong with my code?

    use the text property of your textfield (and that property is a string, not a number). try:
    CheckSound();
    function CheckSound():void
    if(options_mc.onoff_txt.text == "100")
    tchannel = theme.play(0,9999);
    else if(options_mc.onoff_txt.text == "0")
    trace("noplay");

Maybe you are looking for