Help With Swapping A Movie Clip

homerreg.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
homerreg.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
homerreg.buttonMode=true;
function mouseDownHandler(evt:MouseEvent):void{
     homerreg.startDrag();
     homerreg.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
function mouseUpHandler(evt:MouseEvent):void {
     homerreg.stopDrag();
     homerreg.removeEventListener(MouseEvent.MOUSE_MOVE  , mouseMoveHandler);
function mouseMoveHandler(evt:MouseEvent):void{
     if (homerreg.x>pumpkin.x){
          homerreg.alpha = 0.4;
     homerreg and homerzombie are movieclips. This is from a tutorial and
the last line states if the homerreg movie clip passes the pumpkin
movie clip in the center of the screen it's alpha channel changes.
What I want to do is swap the "homerreg" movie clip and have the
homerzombie movie clip come in when it passed the pumpkin movie clip.
Anyone know how I could do this?
Thanks in advance.

If you retained the homerreg movieclip as the main one, having regular homer on frame 1 and zombie homer on frame 2, then the following code should work in place of what you had before...
function mouseMoveHandler(evt:MouseEvent):void{
     if (homerreg.x>pumpkin.x){
          homerreg.gotoAndStop(2);

Similar Messages

  • HELP WITH AS3 Removing Movie Clip

    every code i try in the action script to remove a movie clip off of the stage does not work. HELPPPP.

    well this is my code to bring it onto the stage
    import flash.events.MouseEvent;
    pills.addEventListener(MouseEvent.CLICK, arrest)
    function arrest(pEvent:MouseEvent):void{
              if(pEvent.target==pills){
                        var carimage: policecar= new policecar();
                        carimage.x=0;
                        carimage.y=0;
                        this.addChild(carimage);
    and the remove is under a different clip
    stop();
    bars1.addEventListener(MouseEvent.ROLL_OVER, barsout)
    function barsout(pEvent:MouseEvent):void{
              if(pEvent.target==bars1){
                        this.removeChild(carimage);
    even when i add the latter code into the origininal code above it tells me access of undefined property (carimage)

  • I need to delete a variable containing a movie clip class and recreate it with a different movie clip class

    Hello,
    I am creating a program that is going to help students learn to read. In my project are pages of text with each word having a button that when pressed will display a movieclip presentation about that word (its pronounciation and spelling etc..). In the project I am working on now I have over 450 unique presentations of words to deal with. I don't want to have all of these hundreds of movie clips on the stage and tell them one at a time to stop and rewind and then have one play each time a word button is pressed. That seems to be very inefficient to me. So I want to do this with some code in Actionscript 3.
    I know I can dynamically add movieclips to the stage using addChild(movieclipname) and remove them using removeChild(movieclipname) but there is a problem. I have hundreds of unique movieclips and I don't want to have to manage hundreds of variables containing the indivudual movieclip instancess. It is a real pain having to figure out what instance is still on the stage before i delete it.
    In Adobe Director all I have to do is this:
    on mousedown me
         sprite(me.spritenum).member = member("somenewmember:)
    end
    and that was it
    But if I do this in actionscript 3:
    removeChild(some_mc)
    some_mc still exists in memory. And I have to know exactly what variable it is to remove or else the movie will fail with an error. If I try to be brutish about it and try to implicitly remove all 450 movieclip instance variables from the stage I will get at least 449 errors.
    What I want to do is this:
    removeChild(some_mc)
    some_mc = void //or //delete some_mc
    var some_mc:MovieClip = new someother_mc();
    addChild(some_mc)
    but this doesn't work
    How am I going to remove one of 450 movie clips and add a new totally different movie clip without the code knowing exactly what the last movie clip was? I suppose if could remove a child from the stage based on a string name then I could hold that name in a variable for later disposal.Can I do this?
    Thanks for any help you can give me. I am new to actionscript.

    Hey I think I may have a solution:
    //begin code
    var myMC:MovieClip = new ball();
    var starMC:MovieClip = new star();
    var youpresseeditMC:MovieClip = new youpresseedit();
    starMC.name = "star";
    myMC.name = "ball";
    youpresseeditMC.name = "youpresseedit"
    addChild(myMC);
    box.addEventListener(MouseEvent.MOUSE_DOWN, replaceball);
    press_BTN.addEventListener(MouseEvent.MOUSE_DOWN, replaceballwithtext);
    function replaceball(event:MouseEvent):void {
        trace(myMC.name)
        removeChild(myMC);
        myMC = starMC;
        addChild(myMC);
        trace(myMC.name)
    function replaceballwithtext(event:MouseEvent):void {
        trace(myMC.name)
        removeChild(myMC);
        myMC = youpresseeditMC;
        addChild(myMC);
        trace(myMC.name)
    ///end code
    This works. I see the ball object replaced  by the star and I am able to do this by manipulating just myMC. Is there anything I should be concerned with in this approach?
    Thanks for your help

  • Problem with non loading movie clips in CS3

    Hi.
    I am making an animation ( Trailer for an upcoming handheld
    game i am working on ).
    And i have encountered a problem when i play back the
    animation with Flash player.
    There is two movie clips in the animation ( Normal vector
    drawing but with effects applied on it ( color adjustment , and
    blur ) ) and when i play the published swf back with flash player
    the two movie clips are in their normal Vector mode ( without the
    filters ) until the middle of the animation when they finally
    "load" , the filters finally have an effect on the two vector
    drawings.
    i use a very high end computer so that couldn't be it.
    And when i am going to upload the flash film there's going to
    be a loading screen ... i have no clue if it's going to fix this.
    But for now this is really odd and looks really awkward.
    If this problem persist i will not make the deadline. please
    help fast.
    Thanks everybody.
    -Jimmy Gonzo
    EDIT: oh and i also noticed that when the stuff isn't loaded
    yet... the animation goes too fast.

    It seems to me that you need to put a preloader in the first
    frame of your whole .fla. It seems that all your assets are not
    being loaded before the .swf playhead moves forward.
    A simple preloader could be something like:
    frame 1 label this as "preloader"
    frame 2 (insert the following commands)
    if (this._framesloaded >= this._totalframes) {
    this.gotoAndPlay("init");
    }else{
    this.gotoAndPlay("preloader");
    }

  • A really annoying problem with a button/movie clip

    I am having a problem with a button! its driving me insane
    because i managed to do it last week, but that was by chance and
    now i can't remember how i did it!
    I can get the button (i'm using gelright from the common
    libraries panel) and convert it to a movie clip(by pressing F8) and
    even attach a behaviour but when i play the movie it doen't work!
    when i move the curser over the button it changes into a hand, but
    will not act like a button, even though i have set the behaviour to
    'on release, go to and play keyframe 2'.
    Please help me, for the sake of my laptop goin through the
    wall!

    virgosam20 wrote:
    > first, i found the button i wanted in the common
    libraries (gelright) and
    > added it to the stage. I resized it and converted it
    into a symbol as a movie
    > clip. Then it got added to my library.
    > Then i deleted it from the stage and replaced it with
    the movie cip version i
    > had just converted it to. so now i have the same object
    on the stage, but now
    > its a movie clip and not a button.
    ok - you are running yourself around in circles - why did you
    delete it to the stage only to add it
    again? once you converted it to a movie clip, you had what
    you wanted on the stage - but then you
    deleted it and dragged another instance of the same symbol
    back onto the stage - there's no reason
    to do that.
    > Then i double clicked on it to bring up the movie clip
    timeline, but instead
    > of saying 'top, down, over, hit' (or whatever it says),
    it jsut said 'layer 1'
    > (but this was not my original stage as i have a number
    of layers on that one).
    Right - this is expected because yoyu are now inside the
    movie clip timeline - not the button timeline.
    > When i double clicked on it again, it brought up the
    right headings (top, down,
    > over, etc),
    Right - because by double clicking the button symbol you were
    then brought to "edit mode" for the
    button symbol.
    but there were about 5 layers that showed the different
    layers for
    > the original button.
    Huh? What "5 layers"? What do you mean "original" button -
    per your description there has only ever
    been 1 button you have been working with.
    > I think i have to add the button to each of the
    headings, bt there is no room,
    Lost you completely now - what do you mean add the button to
    each heading? I have no clue what you mean.
    > as when i did it before, there was only one layer for it
    and i had to insert
    > the key frames myself.
    Still losing you here.
    > I then added a behaviour to it using the Behaviours
    pannel, (selected
    > movieclip, then 'go to and play....') and it appears in
    the behaviours pannel.
    > But when i got to Play Movie, although the curser
    changes into a hand, the
    > button does not work.
    That's because you are applying a behavior for a button to a
    movie clip instead.
    I think you went wrong when you converted the button to a
    movie clip - i have no idea why you did
    that or why to think your button needs to be in a movie clip.
    >
    > Hope that can help you with what i've done and you can
    tell me where i've gone
    > wrong.
    >
    I just think you don't understand how timelines, symbols or
    buttons work yet in flash.
    1. drag a button to the stage.
    2. select it and open the Behaviors panel (dont double click
    it to edit it).
    3. add your actions.
    4. test movie.
    (no need for a movie clip here.
    -chris

  • *Class Project - Please help:  Why does my movie clip keep playing over and over?

    I am desperate for help on this one as its my Final Flash
    class project and I just can't get my scenes/movie clips to play in
    the order I want them to.
    I have Scene 1 (movie clip 1) that plays and then Scene 2
    (movie clip 2) plays. The problem is that Scene 2 (or movie clip 2)
    repeats itself over and over again. I can't get it to go back to
    Scene 1 (movie clip 1) to play that again.
    I want it go to to this Scene 1 and actually start at a
    certain frame to continue on with the story.
    I have named my movie clip instances.
    What am I doing wrong? I went into movie clip 2, into
    actions, and movie clip control, and I don't really see a way to
    tell it to go back and play movie clip 1. Trying to see how to
    refer back to the instance name of the movie clip and get it to
    play.
    Ideas? Please please? I would be forever greatful.
    Angie

    quote:
    Originally posted by:
    computerkitten
    I wonder if I should just take that movie clip out of the
    scene completely.... and not have the second scene at all. Maybe I
    should just have 1 scene and these 2 movie clips. Wonder if that
    would work better?
    As Nickels55 said, above, scenes add unnecessary complexity.
    So the answer to this is: YES. Scenes are awkward in Flash. Never
    use them in any final project. Put everything on a single timeline
    in a single scene, and you will have much better control of the
    project.

  • Help with swap images using rollovers

    I have a website created using DW CS5. Recently purchased FW CS5 to help with web graphics and design. I am trying to create a list of numbers that will swap with images. The intial page would simply be a list of numbers and 1 static image. Each number, when hovered will change the image with another. I've attempted this by first using DW and not having much success with FW either.
    If able to complete this using FW, is it possible to export the file for use in DW? Then insert into an AP Div?

    You're over-complicating it.
    Simply hit File>Save once you're done in photoshop.
    ian

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

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

  • Help with splitting and arranging clips

    Hi All,
    Can some please help a complete noob by explaining their simple workflow for FCE HD from after capture to edit.
    I am new to digital editing and am working my way through Tom's book but am a little confused in regards to arranging and organising my clips. I have a new project (My niece's 1st B'day party) which currently has 1 master clip (I think this is the terminology) with several (27) segments after running DV Start/Stop.
    This is where I get confused. I want to arrange the segments into Bins, for example: Birthday girl, cake, games etc... But there is something about relationships between master clip, segments and subclips which I don't understand.
    How is the best way to "cut up" (and is that the best way) the segments into smaller master clips so i can rename then, rearrange them and add comments in preperation for editing?
    Sorry for the long post, but when you don't really know what you want to say you end up saying a lot
    Cheers.
    Andrew

    I don't use the Master/Subclip relationships. My method of sorting out various types of clip, by subject (your examples of "Birthday girl, cake, games etc...") is to slide (click, hold and drag) all obviously bad clips into V3 and ignore (mostly), and then slide all the Birthday girl clips on to V2 and move them sideways to group them closer together, then do the same for each other group. This leaves in V1 some shots such as establishing shots, closeups of decorations, departures etc. which you know where to put (eg., establishing shots at the beginning, closeups cut in somewhere where suitable as the editing proceeds). Next, I drag down and left or right various clips from V2 to V1 to their appropriate positions in order, leaving gaps between here and there to avoid having to move sets of clips left and right too often to make room. Then I set In and Out points in the Timeline (or Viewer) and close gaps between the clips within each set and see how that set looks. When all the material has gone through that process I check the whole video and make (usually) minor) changes, then do transitions and set audio levels, then leave it for a few days to look at it afresh.
    Is this a bizarre method? What do you pros do?

  • Can anyone help with emailing a video clip?

    I want to email a video clip to a person that uses a PC. I have sent it as a "quick time movie file" and as an "MPEG 4 video type" and the recipient is not able to view the video. In one format, the video would play but was only a white screen. In my "send" box, I can play the video fine. Can I convert it some other way to make it accessible to someone with a PC?
    Thanks for any help!

    Mr. Brewer is correct. That's a quick and easy way to remedy that situation...
    Sly

  • Need Help with timing using multiple clips

    I am in need of some help. I am trying to have a total of 16 video clips appear to slide across the screen from the right to the left, all while being equally spaced apart, going the same speed without them crossing over one another. I am using the center and anchor point in the motion tab, but once i get the the third clip i just cant seem to get the time right. I basically want them to come into the screen from the left and out of the screen from the right, all while scrolling acrossed. Please let me know if you have any suggestions.
    I even trued manipulating idvd and imovie themes in Quartz Composer, ended up starting fresh and new, and then again got into the mess with timing. Please help!!!!
    Thanks so much,

    Try this:
    Copy one clip that works OK and use Paste Attributes on the shonky one.
    Al

  • Need help with swapping footage and solid 3d layer

    Here's my situation: I have a .mov file which i want to place inside that red solid layer [1]. I hold option and drag on top of the solid layer and it is swapped in the timeline. However, it gets placed at the very end of the comp as a single-frame snippet on the 6f mark, rather than at the beginning for the full duration of the video [2]. If I try to drag my video to the beginning of the timeline with my cursor, the track doesn't budge. Any idea why I might be experiencing these issues?
    1.
    2.

    Did you not time-reverse the layers yourself? How did they get like this if you didn't do it?
    You time-reverse a layer using the menu command Layer > Time > Time-reverse Layer.

  • Help with QT 360 Mov files.. (active X)

    I make 360 tours for realestate sites and now im getting this message that says "click to run an Acitive X control on this webpage" This pop up message is new. Is it a new security download from Microsoft? Please help on getting rid of this pop up message.
    This is an example
    http://www.pointsourcemedia.ca/clients/0000001/0000010/
    Thanx

    Thanks QuickTimeKirk for posting that reply. I have almost got it. I have been doing this update to all pages where I have Flash files and it has been working (method 1) but now I have a page that as a QTVR movie on it and it's just not working. Perhaps you can help me out? In your note you show an object tag with a classid, I had a look at the cod I have for my vr movie and there is no such thing, what should I do?
    TAG THAT WAS USED TO PLACE MY QTVR MOVIE:
    <embed src="vr_tourSnd.mov" width="400" height="180"></embed>
    TAG THAT NOW REPLACES THE ABOVE STRING:
    <script language="JavaScript"type="text/javascript">RunAXqtvr();</script>
    TAG THAT I PLACED IN THE HEAD TAG:
    <script src="AXqtvr.js" type="text/javascript"></script>
    CODE THAT IS IN THE EXTERNAL JS WHICH IS CALLED AXqtvr.js:
    function RunAXqtvr()
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#v ersion=6,0,29,0" width="565" height="400">\n');
    document.write('<param name="src" value=" vr_tourSnd.mov">\n');
    document.write('</object>\n');
    I am guessing I need to replace that object classid from the Macromedia stuff to something else but what.
    You should also know that all files are in the same directory:
    vrtour.html, AXqtvr.js and vr_tourSnd.mov
    Got any clues?

  • Please help with creating QTVR movie

    Hi I'm trying to create a QTVR for the first time and I'm using VR Worx.
    I intend to make a drawing referring to photos and use the drawing as a single pano image for a QTVR movie.
    First I decided to learn the creation process by using this Image:
    http://storage.vrantwerp.com/previews/vrijdagmarkt-antwerp-2_preview.jpg
    from this page:
    http://www.vrantwerp.com/index.php?tag=square
    This is the movie created with a higher resolution of that image
    http://www.vrantwerp.com/vr/vrijdagmarkt-antwerp-2/full-quicktime.html
    When I used the low res image for my test, my movie didn't come as expected. VR Worx distors the image. From this link you can download my file showing the problem
    http://savefile.com/files/1368933
    I appreciate any help
    Thank you

    I tuned the Place holder into a YouTube Video Widget, and it does display on the homepage, but it does not display as a video. It displays as a still image that the reader has to click on to access the entry and then play the video in the entry instead of playing right on the homepage.
    For the multiple images, are you saying that I can only have one placeholder? I do not follow. I want multiple placeholders for multiple images throughout the single entry (ex: http://offysports.blogspot.com/2010/05/2009-10-panini-studio-basketball.html)
    Thanks

Maybe you are looking for

  • Can't download a file because I don't have privileges.

    I need to install a program on my iMac which I just downloadeD. When I drag it from my desktop to my folder it tells me I don't have privileges to do this. What do I need to change to make this happen?

  • JDev 11.1.1.2.0 - ojsp.next mode - error with scriptlets

    So, the JDev started to reject running the application, saying OracleJSP error: oracle.jsp.parse.JavaCodeException: Line # 3, oracle.jsp.parse.JspParseTagScriptlet@1213caa Error: Java code in jsp source files is not allowed in ojsp.next mode. The scr

  • How to embed a pdf in a pdf file like we embed in MS word/PPT

    Please help me I receive some jobs in word files (sometimes in PPT) with PDFs embeded and want me to make compatible for viewing on ipad and PC as well. I found creating/inserting navigation menus in PDF itself could help me in flowing as the solutio

  • Droid RazrMaxx battery problems after ICS update

    I purchased a RazrMaxx in June and updated it to ICS on June 29. Since the ICS update the battery life on the phone went downhill. After a 100% charge and having the phone on standby for the last 14hrs 15min, I have only 30% battery life. I reset the

  • Does JavaFX supports Constructive area geometry (CAG)?

    Java2D as a incredible constructive area geometry (CAG) http://docs.oracle.com/javase/tutorial/2d/advanced/complexshapes.html with support for union, intersection, subtraction and Exclusive-or (XOR) for Shapes. Does exists any thing similar in JavaFX