Convert Gaphics into Move Clip

Here, I am create three files. Box.as for making graphich dimentional box, Drag.as is for dragging movieClip and ShowBox.as is to display draggalbe box. I would like to see box with draggable faclity. But I am getting error followig error.
Description : 1067:Implicit coercion of a value of type Box to an unrelated type flash.display:MovieClip  on Show Box
Might be I am getting problem of converting into move clip but I am not sure. Would u mind u you gind me in this problem/
Box.as
package {
     import flash.geom.*;
    import flash.display.Shape;
     import flash.display.Sprite;
     public class Box extends Sprite {
          public var box:Shape;
          public var boxWidth:Number;
          public var boxHeight:Number;
          public var boxColor:Number;
          public var boxBorderSize:Number;
          public var boxBorderColor:Number;
          public function Box() {
               //Assign Value
               boxHeight=100;
               boxWidth=100;
               boxColor=0x000000;
               boxBorderSize=1;
               boxBorderColor=0xCCCCCC;
               box=new Shape();
               box.graphics.lineStyle(boxBorderSize,boxBorderColor);
               box.graphics.beginFill(boxColor);
               box.graphics.drawRect(0,0,boxWidth,boxHeight);
               this.addChild(box);
Drag.as
package{
    import flash.events.*;
    import flash.display.Sprite;
    import flash.display.MovieClip;
    public class Drag extends Sprite
        public var clip:MovieClip;
        function dragBox(myClip:MovieClip)
                clip=myClip;
                clip=new MovieClip();
                clip.addEventListener(MouseEvent.MOUSE_DOWN,startMyDrag);
                clip.addEventListener(MouseEvent.MOUSE_UP,stopMyDrag);
                addChild(clip);
                function startMyDrag(evnt:MouseEvent)
                    clip.startDrag();
                function stopMyDrag(evnt:MouseEvent)
                    clip.stopDrag();
ShowBox.as
package{
     import flash.display.Sprite;
     public class ShowBox extends Sprite
          public var myMask:Box;
          public function ShowBox()
                myMask=new Box();    
               myMask.boxHeight=100;
               myMask.boxWidth=100;
               myMask.boxColor=0x000000;
               myMask.boxBorderSize=1;
               myMask.boxBorderColor=0xCCCCCC;
               addChild(myMask);
               var myDrag:Drag=new Drag();
               myDrag.dragBox(myMask);
               addChild(myDrag);

I do not understand. Acutally, I want to drag the box . Thus, I want to make it movie clip throug AS. I have made graphic rectangular but could not convert nto movi clip. Is there any function so that I could change my graphic into movie clip .

Similar Messages

  • Successfully imported external swf, can not put it into movie clip

    Hello all,
    I have started learning AS3 and gradually getting used to, trying to put external swf into movie clip.
    Successfully imported target swf and put into stage, when I publish this I see target swf is playing.
    import flash.display.MovieClip;
    var BGLoader:Loader = new Loader();
    var BGurl:URLRequest = new URLRequest("HomeBG.swf");
    BGLoader.load(BGurl);
    BGLoader.y = 0;
    BGLoader.x = 0;
    addChild(BGLoader);
    As next step I want to put this swf into movie clip and get more control, but when I publish bellow only I see is empty background, without any errors.
    import flash.display.MovieClip;
    var BGLoader:Loader = new Loader();
    var BGurl:URLRequest = new URLRequest("HomeBG.swf");
    BGLoader.load(BGurl);
    BGLoader.y = 0;
    BGLoader.x = 0;
    //addChild(BGLoader);
    var animMC = MovieClip(BGLoader.content).getChildAt(0) as MovieClip;
    addChild(animMC);
    Is anything missing?
    Any help would be appreciated, thanks.

    You can only access Loader.content after Load completed successfully.
    Try this,
    import flash.events.Event;
    var BGLoader:Loader = new Loader();
    var BGurl:URLRequest = new URLRequest("HomeBG.swf");
    BGLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
    BGLoader.load(BGurl);
    BGLoader.y = 0;
    BGLoader.x = 0;
    //addChild(BGLoader);
    var animMC:MovieClip;
    function completeHandler(event:Event)
         animMC = event.currentTarget.content;
         addChild(animMC);

  • Loading JPGs into Movie Clip

    Can anyone help? I am building a site that requires the user
    to click on a button to change a large JPG image in a movie clip.
    The button is part of a small movie clip that contains a text
    number which is the button in question and a thumbnail of the large
    image. I need the button to play when rolled out (to fade out the
    thumbnail image) and I need the large JPG image to be replaced by
    another large JPG image when the button is released. The button
    instance is "Load Image" and the movie clip I want the new JPG to
    load into is called "Holding Pic". Should I put the action script
    on the main timeline? If so, where? Or should I attach the script
    to the button?
    Many thanks.

    This is an article on AS3 but the answer to your question is
    the same. You can find it in the first few paragraphs.
    http://www.adobe.com/designcenter/flash/articles/flacs3it_astimeline.html

  • Closing swf loaded into movie clip

    I have built a movie clip on my main flash file that I am loading separate swfs into. On the separate swfs I have a close button, but do not know what action script to attach to it to make the movie clip go away? I want these to go away every time you hit the close button on the separate Flash swfs loading into the main movie clip.

    if the target movieclip has a non-negative depth and the close button is encoded on the loaded swf's main timeline, you can use:
    var tl:MovieClip=this;
    path.closeBtn.onRelease=function(){
    tl.removeMovieClip();

  • HELP! Converting MPEG4 into Mov, AVI, WMV

    I made a small clip on iMovie. I need to upload to a website for my band. I clicked on Share then export movie to my desktop. The website clearly says..."For video, we accept the following formats: WMV, MOV, AVI, MPG, MP4, FLV"
    Also, "SPECIAL NOTE ABOUT VIDEO:
    GigMasters will automatically convert all WMV, MOV, AVI, MPG, and MP4 files to FLV. The conversion process will change the size of your video to 320 x 240 if it's not that size already. Also, the "audio sampling rate" of the video must be 11025 hz, 22050 hz, or 44,100 hz. Otherwise the audio may be garbled on playback."
    Everytime I try to upload it tells me, "We do not accept the format of the file you selected. Please make sure your file format matches one of those listed above."
    Somebody please help. Thank you.

    If using 4:3, which would be better given the AR of the movie required by your website, using the export to movie and then choosing the mobile size should be just fine. However your website may not like the .m4v extension added to the movie, in which case simply open the movie in Quicktime and select save as from the file menu, the resulting video will now be in a .mov container which you can then try uploading to your website.

  • Putting movie clips in AS3 package into movie clip on stage

    Hi - I am a as2/flash animator and am working on an AS3
    project. The AS is in a separate file, inside a package. I am
    modifying existing code.
    The script adds movie clips in a function via addchild.
    What I am hoping to do, is have the movieclips added to a
    clip that already exists on the stage.
    I put a clip on the stage named holder, with the instance
    name holder_mc - and I tried to add the clip with
    holder_mc.addchild in the AS3 file - it seemed to work, but
    manipulating the holder_mc - it looks like the added clips are not
    affected?
    Any help is appreciated.

    Child_array is a property of the Parent class.
    It's only added to in one point, in a function that creates a
    Child and adds it to the array.
    I think I might have found out the problem with my code after
    adding a trace to the function, think I'm creating twice the number
    of clips I'm removing, and the deletion part of my code is fine!
    Turns out AS3 is maybe not so bad after all :P
    Thanks alot for taking the time to reply though kglad!

  • Converting .m4a into .mov with Quick Time?

    trying to convert a .m4a file I pulled from itunes library into a .mov for use in FC7. this was easy to do in Snow leopard w/same quicktime10 with "save as" the option is not there in Lion, only export which does not have a .mov option. what am I missing or do I need another app now? I can't do it in Stream Clip either.

    nevermind, I found Quicktime7 in my aplications and used that to do the conversion.

  • Make action script into movie clip

    Hi,
    I have used some action script to make a turning wheel with several logos in it. Now I want to make that wheel into one single movie click so I can zoom in and out when mouse over. How would I do this?
    Here is the file with the action script
    http://www.weidts.de/cs3.zip

    you have a button with what instance name on which timeline
    that should direct which movieclip to what frame?

  • Turning a layered animation into movie clip

    I am a flash newbie so this may be a retarded question. I am
    trying to turn a multilayered Flash animation into a movieclip
    symbol. I have shapes on different layers that are shape tweened
    and many shape hints that go with them. When I go to create a new
    symbol and paste my frames the shape hints don't end up in the same
    place as the shapes. Is there a way to keep the shapes and hints
    together as I copy and paste frames? Is there an easier way to turn
    this into a movieclip in the fist place?

    knealis wrote:
    > I am a flash newbie so this may be a retarded question.
    I am trying to turn a
    > multilayered Flash animation into a movieclip symbol. I
    have shapes on
    > different layers that are shape tweened and many shape
    hints that go with them.
    > When I go to create a new symbol and paste my frames the
    shape hints don't end
    > up in the same place as the shapes. Is there a way to
    keep the shapes and
    > hints together as I copy and paste frames? Is there an
    easier way to turn this
    > into a movieclip in the fist place?
    No, there is no easier way, only Copy Paste frames.
    Regards
    Urami
    Happy New Year guys - all the best there is in the 2006 :)
    <urami>
    http://www.Flashfugitive.com
    </urami>
    <web junk free>
    http://www.firefox.com
    </web junk free>

  • Can't drag and drop or import movie clips or ver. 8 projects into iMovie 9

    Hello:
    I just installed Leopard (OS X) with iLife and iWork (although I didn't actually install iWork). I can't drag and drop .mov or .dv files into a project. If I "File-->Import-->Movies", all the types I want to import (.mov & .dv) are grayed-out. I created and saved a project with the older version of iMovie (8) and then tried to import it into iMovie 9. The result is a message in the clips panel that says "No matching video. Choose a different options from the Show pop-up menu at the lower left corner." So far, everything I wanted to do is bust. Can somebody help?
    Thanks.
    Etude.

    annadex wrote:
    I have tuns of .mp4 clips, converted them to .mov clips... .
    How?
    easy way:
    • double-click mp4 to open it in QuicktimePlayer.app
    (does it play the video?)
    • File/Export/choose 720p (if optional, if not 480p)
    • import THAT into iMovie using iMovies import routine, proceed …

  • Converting an image sequence to a Movie Clip - Flash CC

    Hi Everyone,
    Hopefully I am just doing this wrong.
    I have a sequence of images I want to convert to a movie clip symbol.
    This is what I'm doing:
    I select all the frames in the timeline and hit f8 & choose movie clip as the symbol type.
    When I drop the newly created symbol back on the stage it only contains the very last frame
    of the animation.
    Is this just not possible?

    You can do this.  Here are the steps:
    1.  Select desired frames
    2.  Copy frames
    3.  Create movie clip symbol
    4.  Paste frames into movie clip symbol
    If this is something you do frequently, there are extensions that streamline this process.
    Edit:  Here's a link to the extension "New Anim Clip".  It's about a third the way down the page.
    http://www.toonmonkey.com/extensions.html

  • How do I get a movie clip to follow the cursor?

    Hi guys,
    What I want:
    Is a simple action where I have my company logo in the middle of the screen and it follows the cursor (not over the whole screen but within invisible borders).
    What I use:
    I have Flash Pro CS5, code is Actionscript 3.0 and my company logo has been converted to a movie clip.
    What didn't work:
    So I watched 2 different tutorials on how to do this and both didn't work.
    With the first one I used this code:
    function gradientOver(event:MouseEvent):void{
              logomc.visible=true;
              function reportStageMouse(event:MouseEvent):void{
                        var myStageX:Number=Math.round(event.stageX);
                        var myStageY:Number=Math.round(event.stageY);
                        var xTween:Tween=new Tween(logomc,"x", Strong.easeOut, logomc.x, myStageX, 1, true);
                        var yTween:Tween=new Tween(logomc,"y", Strong.easeOut, logomc.y, myStageY, 1, true);
              stage.addEventListener(MouseEvent.MOUSE_MOVE,reportStageMouse);
    function gradientOut(event:MouseEvent):void{
              logomc.visible=false;
    function gradientClick(event:MouseEvent):void{
              logomc.visible=false;
    gradient.addEventListener(MouseEvent.ROLL_OVER,gradientOver);
    gradient.addEventListener(MouseEvent.ROLL_OUT,gradientOut);
    gradient.addEventListener(MouseEvent.CLICK,gradientClick);
    And with the second one I had to make a border by drawing an oval shape, turn it into a movie clip and put my logo inside of it. Then I used this code:
    stage.addEventListener("mouseMove", arjun);
    function arjun(e:MouseEvent):void
              var var1 = mouseY - followins.y;
              var var2 = mouseX - followins.x;
              var radiusR = Math.atan2(var1,var2);
              var degreeR = radiusR / (Math.PI / 180);
              followins.rotation = degreeR;

    Thanks
    stage.addEventListener(MouseEvent.MOUSE_MOVE, hideCursor);
    function hideCursor(e:MouseEvent):void{
    logomc.startDrag(true);
    Mouse.hide(true);
    so I used this code and it didn't work. I first try'd it on the main timeline and then inside the logo's own timeline and even inside the backgrounds own timeline.
    no luck so far..

  • Movie clips

    How can I convert layered .fla or .swf files into movie clips (not sure which to use)? I'd like to be able to use 3 of them (at reduced sizes) in one larger file. Flash - CS3. Thanks in advance.

    I did that using timeline/copy frames, but when I select timeline/
    paste frames - they're not in the correct position. Is there a paste 
    in position command I don't know?

  • Play multiple movie clips - with sound

    Hello Forum members,
    I am a total new comer in terms of flash and action script,
    self-educated and Adobe forum and internet educated. I can now
    click a button and stop and start a movie clip, use attachMovie,
    and even mute sound in a movie clip (not video). I am currently
    using Flash 8, and waiting for CS3 (downloaded a trial, and like it
    better than Flash 8).
    Enough history - now to my question - I have an application
    that had 3 scenes. I read in some Adobe article
    "Flash Best Practices" that it was not a good idea to use
    scenes in an application. I converted my Scene 2 and Scene 3 into
    movie clips.
    I figured I could either put each movie clip on a separate
    layer in my timeline (mc_scene2, mc_scene3)
    and play them, one after the other (did not quite work, more
    later). Or...
    copy the timelines from the scenes, and add those frames to
    my Scene 1, making a application with both scenes staggered one
    after the other in the main timeline. Or...
    Keep Scene 1 and at the end of scene 1,
    attacheMovie("mc_scene2", etc) and when scene 2 was done play and
    or attach the final movie clip (mc_scene3).
    I could not figure out how to tell when mc_scene2 was done
    using the attacheMovie method, so I could then attach mc_scene3,
    etc.
    How would I be able to tell when one attached or loaded movie
    clip is finished, and then start the next one?
    Or what is the suggested way to use actionscript to load a
    movie, play it, and when the clip is done, load and play the next,
    etc.
    Thanks for a good forum,
    eholz1

    Hello Again - I guess there is much that I do not understand.
    I followed the tip above - or so I thought.
    I have "buttons" on my movie clips that play the clip when
    clicked.
    I have placed stop actions in frame 1 of each movie clip.
    I tried placing mc_scene2 and mc_scene3 on their own layer
    in the timeline,
    and put the code above in my actions layer (Scene 1).
    it seems that nothing really works - the _visible property
    seems not to work,
    etc - I must be doing something wrong. What layer should the
    two mc's be
    placed?
    Thanks for the info
    Eholz1

  • Is it possible to stop a tween in a movie clip

    Hello Kglad and other forum expert!
    I have a movie clip (really just an image converted to a
    movie clip).
    I a "zoom" effect set on two layers - on for the zoom mask,
    and the other for the base image.
    I just use the modify/transform in some keyframes to have the
    image motion tween from normal size to a larger size.
    The tween (aka zoom) is shown through the mask layer.
    I did not create the motion tween using actionscript, but in
    the timeline between 2 keyframes.
    Is there a way I can stop the tween when the movie plays ( by
    clicking a "pause" button).
    Thanks for a great info resource,
    eholz1

    you can use the stop() method of movieclips to stop the
    timeline of the tweening movieclip. you can use the play() method
    to continue to tweening.

Maybe you are looking for