Problem attaching external .jpgs to movie clips

Hi There,
I am not able to attach a file (.jpg) outside of flash to a
movieClip without it changing the scale of the image. Stepping
through with the debugger, its clear the image loads correctly til
it is applied to the movie clip, I assume with the attachBitmap
function. It scales it up a little more than 50% and I can't figure
out where that scale is coming from. It appears to scale up from
the upper left corner. We have checked to make sure all the
movieclips within our flash file are the exact same size as the
image files (150 X 150). Please see code example. Everything is
fine except for this. We tried using the matrix transformation to
down size the images but the quality was not acceptable even with
using smoothing and pixel snapping.
So, the basic question being, how do we use attachBitmap and
have it preserve the original size? Any ideas for how to get this
to work is greatly appreciated...
thanks,
Laura

well I'm afraid there are a few things that are not quite
right with the method here - however, the real problem is most
likely that the original image resolution is higher than 72 dpi -
it must be set at standard screen res or Flash will scale it up
uniformly to work at 72.
I think that you may have more success with something more
like this:

Similar Messages

  • 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

  • Center external jpg in movie?

    Is it possible to externally load jpgs with different
    dimensions which would center with the movie clips registration
    point instead of aligning with the upper left default point? Here
    is the code I am using currently for each button calling the jpg to
    be loaded into the movie clip.
    Also, is there a way to have flash put a border stroke around
    each jpg that is loaded?

    Well the MovieClipLoader is the way to go -- as long as you
    are publishing for Flash 7 or higher.
    The jpeg is always going to have the upper left corner at
    0,0. There is nothing that can be done about that. What CAN BE DONE
    is that the 0,0 can be moved so it looks like the jpeg is centered.
    So if all you want to to is make it looks like the center of
    the graphic is where the 0,0 point was you would move left by half
    the width and move up by half the height.
    I'm not sure if the code provided above will work (probably
    should) but it isn't quite in the form specified in the help files.
    var container:MovieClip =
    createEmptyMovieClip("container",100);
    container._x=200;
    container._y=100
    var MCL:MovieClipLoader=new MovieClipLoader();
    var listener:Object=new Object():
    listener.onLoadInit=function(target:MovieClip){
    target._x-=(target._width/2);
    target._y-=(target._height/2);
    MCL.addListener(listener);
    MCL.loadClip("yourfile.jpg",container);
    That should make it look like the external graphic is
    centered on (200,100).

  • Problems with button inside draggable movie clip

    I am building a click through presentation that has some small text in it. To maintain the design and allow for readability, I have added a zoom feature.
    Here is the structure of the movie,
    Stage - contains pages movie clip and forward/reverse click buttons for changing pages
         pages_mc - contains 24 frames, one page per frame and buttons
    There is a button at the _root level that uses a tweener to scale the pages_mc up to 170%. When this is clicked, it allows the pages to be dragged around the screen so you can look at different sections. When you click the button again, it returns the pages back to their original size stops drag.
    My problem is, on the pages, there are buttons with links to external sites. Once startDrag has been invoked, I cannot touch the buttons inside the movie clip. Is there a way to make these buttons work?
    I need the finished quickly so any assistance is welcome.
    Code below
    magUp_btn.onRelease = function() {
    this._visible = false;
    TweenLite.to(pages_mc, .25, {_x:-250, _y:-193, _xscale:170, _yscale:170});
    TweenLite.to(magUp_mc, .75, {_alpha:0});
    TweenLite.to(magDown_mc, .75, {_alpha:25});
    magDown_btn._visible = true;
    pages_mc.onPress = function(){
    this.startDrag();
    pages_mc.onRelease = function(){
    this.stopDrag();
    pages_mc.onReleaseOutside = function(){
    this.stopDrag();
    pages_mc.useHandCursor = false;
    TweenLite.to(instr_mc, 1, {_alpha:100});
    magDown_btn.onRelease = function() {
    TweenLite.to(pages_mc, .25, {_x:0, _y:0, _xscale:100, _yscale:100});
    TweenLite.to(magUp_mc, .75, {_alpha:25});
    TweenLite.to(magDown_mc, .75, {_alpha:0});
    this._visible = false;
    magUp_btn._visible = true;
    pages_mc.onPress = function(){
    this.stopDrag();
    TweenLite.to(instr_mc, 1, {_alpha:0});
    I don't know how to turn drag off when I zoom out without using the onPress command, but I know that this is probably what is getting in the way of the button working?
    Thanks!

    One option is to make the background of the pages be the draggable parts rather than the movieclips that contain the pages and buttons.  That way, the buttons could be atop the background and not have their access blocked.
    Instead of coding the pages_mc, you would essentially have the background coded for the drag...
    pages_mc.bkgnd.onPress = function(){
        startDrag(this._parent);

  • Problem with accessing dynamically created movie clips, returns null...

    Hopefully this is a stupid question with an easy answer, if my code is straight forward enough.
    I am using this snippet of code to create menu items, and then use the jCount variable below to give the clips an index number, like so (which seems to be working just fine):
    for(var j:Number=0;j<xmlSubMenuLength;j++){ 
        var mcSubMenuItem:mcSubMenu=new mcSubMenu();   
        addChild(mcSubMenuItem);    
        jCount++;   
        mcSubMenuItem.name = "mcSubMenuItem" + jCount;
        //traces out names correctly
        trace ("---------------------------------jCount NAME = "+ mcSubMenuItem.name);
        mcSubMenuItem.x=mcMenuHolder.x+20;
        mcSubMenuItem.y =mcMenuHolder.y;
        mcSubMenuItem.y+= nextBtnY;
        nextBtnY+=subtopicSpace;
        global_subi.text = String(jCount); //i see the proper count of 10 in the text field
    However, when I try to access the clips using this snippet:  
    for(var j:Number=0;j<Number(global_subi.text);j++)//
      trace("GLOBAL SUBI = "+ String(global_subi.text));  //traces out 10, which it should
      var scSubMenuItem:String = "mcSubMenuItem" + j;  
      var scSubContent:Object = this.getChildByName(scSubMenuItem);
      trace(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>scSubContent:Object = "+ scSubContent); //returns null!
    My last trace statement returns null. Can anyone see my error, or explain why I can't access my clips after they have been created?
    Thank you muchly,
    ~Chipleh

    Hi kglad,
    Thanks for the response.
    "it's not clear from the shown code that jCount is initialized." - I've posted the relevant code below, which shows that I'm initializing jCount.
    "and it's not clear why you don't use j instead of jCount in that for-loop" - j is used as loop for creating the subtopic movie clips within the i for-loop. So, for each topic in i for-loop, create a group of suptopics using the j for-loop. The j for-loop re-initiates j every time the length of the subtopics is reached(if that makes any sense) - i.e. topic1>subtopic 1,2,3,4 : topic2>subtopic>1,2 : topic3>subtopic1,2,3,4
    jCount is used to keep a running count of the total number of subtopcs created - i.e. per the example above, jCount will display 10.
    var topicSpace:uint=button_mc.height;
    var subtopicSpace:uint = button_mc.height;
    var nextBtnY:uint = 0;//whatever;
    var jCount:Number = 0;
    function createXMLMenu(menuLength:Number,itemName:XMLList):void{
         var navItemText:XMLList = itemName;
          for(var i:Number=0;i<menuLength;i++)
               var mcMenuItem:mcMenu=new mcMenu();        
               addChild(mcMenuItem); 
               mcMenuItem.btnTxt.htmlText = i+1 +". " +navItemText[i];  
               mcMenuItem.ivar = i;  
               mcMenuItem.name = "mcMenuItem" + i;  
               mcMenuItem.x=mcMenuHolder.x;
               mcMenuItem.y =mcMenuHolder.y;
              //kglad's addition
               mcMenuItem.y+= nextBtnY;
               nextBtnY+=topicSpace; 
               var subVar:Number = i;//mcMenuItem.ivar 
               //Submenu content
               var xmlSubMenuLength:Number = xml.sim.bodyText.page[i].subpage.length()
               var menuItemAttachment:MovieClip = MovieClip(mcMenuItem); 
               for(var j:Number=0;j<xmlSubMenuLength;j++)
                     var xmlSubPageNumber:XMLList = xml.sim.bodyText.page[subVar].subpage;
                     var subNavLinkNumber:Number = xmlSubPageNumber[j];
                     var subTitleText:String = xml.sim.bodyText.page[subVar].subpage.subNavItem[j];
                     var mcSubMenuItem:mcSubMenu=new mcSubMenu();
                     trace("mcSubMenuItem.ivar = "+ j+1);
                     var mc2Attach2:MovieClip = MovieClip(menuItemAttachment);
                     mcSubMenuItem.btnTxt.htmlText = j+1 +". " +subTitleText;   
                     mcSubMenuItem.ivar = Number(subVar);
                     mcSubMenuItem.jvar = Number(j);
                     addChild(mcSubMenuItem);
                     jCount++;   
                     mcSubMenuItem.name = "mcSubMenuItem" + jCount;
                     trace ("---------------------------------jCount NAME = "+ mcSubMenuItem.name);
                     mcSubMenuItem.x=mcMenuHolder.x+20;
                     mcSubMenuItem.y =mcMenuHolder.y;
                     //kglad's addition
                     mcSubMenuItem.y+= nextBtnY;
                     nextBtnY+=subtopicSpace;    
                     global_subi.text = String(jCount);
                mcSubMenuItem.lExtend.visible = false;  
    global_i.text = String(i);
    Then I try to access the clips like so:
    -The first for-loop access the topic movie clips, no problem, and traces out scContent correctly.
    -The second for-loop traces out null everytime, when I would expect it to be tracing out the names of the subtopic movie clips.
    function accessClips(){
         //This will access the topic movie clips
         for(var i:Number=0;i<Number(global_i.text);i++)
               var scMenuItem:String = "mcMenuItem" + i;
               var scContent:Object = this.getChildByName(scMenuItem);            
               trace(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>scContent:Object = "+ scContent);
         //This is supposed to access the subtopic movie clips
         for(var j:Number=0;j<Number(global_subi.text);j++)//
               var scSubMenuItem:String = "mcSubMenuItem" + j;
               var scSubContent:Object = this.getChildByName(scSubMenuItem);
               trace(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>scSubContent:Object = "+ scSubContent);
    Hope this makes sense, Chipleh confused. If the code is not clear enough, let me know and I'll try to further clarify.
    Thanks again,
    ~Chipleh

  • Problem attaching external Css...

    Hello all,
    I have been using Dw cs3 for a few months now and currently experiencing the following problem:
    When defining a site root folder in osx it will not accept  / or \ when chaning the / it creates another directory under mac osx. when opening my file then attaching the Css I think that it cannot find the proper file to attach it to.it will insert the Css but will not change the style of the site.
    I wanted to see if it was me or the mac, so I went back to windows installed everthing under C:/files for my site   started DW opened the file and attached the external Css. Worked fine and changed instantly... so I am confused as to is there a way for me to define my local site in mac that its different? am I missing somthing?
    thanks
    quint

    This isn't normal behavior, you may have an issue with your current installation of Dreamweaver. You may want to email Adobe support to see if there's something you can do to avoid having to do a reinstall, other wise this may be the route you have to go.
    Lawrence   *Adobe Community Expert*
    www.Cartweaver.com
    Complete Shopping Cart Application for
    Dreamweaver, available in ASP, PHP and CF

  • Problems attaching scanned jpg images to mail messages

    We are having issues attaching scanned images from a Epson SX600FW all in one printer/scanner/fax machine into mail on my dad's MacBook.
    Basically if I attach a jpeg from any other source (internet or digital camera) to a message, they attach ok but if I attach a file from this printer Mail stops responding and the rotating ball comes up.
    The odd thing is if I attach a file from another source first and then an image from the printer it attaches fine but if I only attach a file from the printer Mail hangs.
    Any ideas anyone ?

    Many times you need Photo Software. This allows your Photo's to be .jpg Format then you can copy and paste, or Drag and Drop. The  Key is the Format of your photos. Many Cameras and other periphials make there scans and photo's .jpg format by default.  If you do not have the software here is a Free on that is comparible too Adobe's Photoshop.
    http://getgimp.com/lp/index.php?pk=6542&c=Getgimp_US_SCM

  • Link external Video with Movie Clip

    Hello all. I captured audio with an external recorder and would like to know how to link it with the clip in the timeline? I currently have them all sync up and would like to have them linked so they are locked and place and any changes in the timeline clips, reflects to the audio file as well. I have tired Shift L and also Apple L and none seem to lock both together. Any help or info appreciated. THanks
    Hector

    If the video and the audio are in the timeline selecting both the video track and the audio track and pressing Cmd-L will link them. If they are in the browser with marked in points you can use the merge clip function.

  • Problems to import Samsung NV24HD movie clips into iMovie08

    I have a Samsung NV24HD Camera:
    - iMovie recognizes the camera
    - iMovie shows that there are film clips, but without thumbnail content
    - iMovie creates an error message after clicking on the import button -> iMovie can't import the video files, I should check them!
    What can I do ?
    thx in advance.
    kd

    im not an expert but you might need to search for a converter. or buy Final Cut Express which recognizes lots more formats but is a bit more complicated to use.
    Hope it helps

  • Attaching an embedded movie clip to an empty one

    HI,
    I am new to Flash and would like some help about the
    following. A have an embeded movie clip in my library that i want
    to attach to an empty movie clip I am creating with ActionScript. I
    want to fix the size of the empty movie clip, that I will use as a
    container to for my embedded movie clip. It turns out that when I
    fix the size of the empty movie clip container and I use
    attachMovie to load the embedded movie clip to it, the image
    doesn't show, I can hear the sound but not the image.
    So the question is , if I have a movie clip container of a
    different size than the movie clipse I want to load into it, what
    do I need to do to make sure the movie clip will fit into the empty
    container.
    thanks
    -malena

    Thanks for the answer, but what I would like to do is to have
    a FIXED size empty clip on the stage and be able to load new clips
    into that empty clip and have the loaded clips resize to fit into
    the empty clip.
    For example the FLVPlayback component does that
    automatically. I can't use the FLVPlayback component because I want
    to be able to control which frame number I want to displaly on the
    screen, and it looks like I can only have that type of frame level
    control wiht a Movie clip component but not with the FLVPlayback
    component.
    -malena

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

  • AttachBitmap movie clip

    I have a local webcam stream appearing on the stage in a
    movieclip.
    When I click a "snapshot button", a still image from the
    webcam gets attached to a new movieclip on the stage with
    attachbitmap and then draw()
    The snapshot shows up in the movieclip on the stage as a
    preview.
    I want to know how to send the data of this bitmap in the
    movieclip to a server (php or coldfusion) to be saved as a JPEG.
    I can't figure out how to access the bmp data and send it to
    a server... any answers?

    i m using Bitmap Data class ..i .e i first use bitmap.draw
    method and then then i attached it to a movie clip by
    movieClip.attachBitmap method....but the problem is that unlike
    attached movieclips which align their centre with the movie clips
    center to which they are attached ,the bitmap image attaches its
    upper left corner with the center of the movie clip to which it is
    attached ... i want to align their centers....Is there ne way to do
    it...
    Please lemme know

  • Choppy movie clips and scenes

    I am having a problem in which I have movie clips containing
    tweens in a file containing two scenes. On publishing, the movie
    clips in Scene A play fine, but the clips within Scene B are very
    choppy -- they appear to be playing only the first and last frames
    of a tween.
    The tweens themselves are definitely OK -- sometimes it
    happens that the clips from Scene B play fine, but then the ones
    from Scene A don't work.
    To see specifically what is happening, you can go to
    http://www.boston.com/news/specials/local/danvers_explosion/interactive_graphic/
    The file is done in two scenes -- one for the content under
    the "The Blast" tab and one for that under "Getting Out." The
    pulsing arrows on the map in "The Blast" are movie clips with
    motion tweens, and these are working correctly. Go to "Getting
    Out," though, and the explosion symbol on that map is supposed to
    expand and fade out, but as you can see, it's not working. But as I
    said, sometimes that clip plays fine, but then the arrows (and
    other clips in "The Blast") don't work.
    This is not the first time I've run into this bug, so I don't
    think it is anything project-specific. Anybody have any
    ideas?

    dont think it is a "bug" because scenes dont exist in the
    compiled SWF - they are only for managing
    your FLA timeline.
    example: say you have 2 scenes 100 frames each. Upon export
    to SWF, frame 1 in scene 2 is really
    frame 101.
    perhaps you just need a preloader?
    can you provide the FLA?
    ~~~~~~~~~~~~~~~~
    --> Adobe Certified Expert
    --> www.mudbubble.com
    --> www.keyframer.com
    ~~~~~~~~~~~~~~~~
    fredward23 wrote:
    > I am having a problem in which I have movie clips
    containing tweens in a file
    > containing two scenes. On publishing, the movie clips in
    Scene A play fine, but
    > the clips within Scene B are very choppy -- they appear
    to be playing only the
    > first and last frames of a tween.
    >
    > The tweens themselves are definitely OK -- sometimes it
    happens that the clips
    > from Scene B play fine, but then the ones from Scene A
    don't work.
    >
    > To see specifically what is happening, you can go to
    >
    >
    http://www.boston.com/news/specials/local/danvers_explosion/interactive_graphic/
    >
    > The file is done in two scenes -- one for the content
    under the "The Blast"
    > tab and one for that under "Getting Out." The pulsing
    arrows on the map in "The
    > Blast" are movie clips with motion tweens, and these are
    working correctly. Go
    > to "Getting Out," though, and the explosion symbol on
    that map is supposed to
    > expand and fade out, but as you can see, it's not
    working. But as I said,
    > sometimes that clip plays fine, but then the arrows (and
    other clips in "The
    > Blast") don't work.
    >
    > This is not the first time I've run into this bug, so I
    don't think it is
    > anything project-specific. Anybody have any ideas?
    >

  • Buttons in Movie Clips, Movie Clips in Movie Clips

    Here goes. I have a scene with a button in the timeline, that
    targets a frame in a movie clip, which is essentially the content
    area of the layout. this is the code used:
    on (release) {
    textmov.gotoAndPlay ("challenge");
    This works fine and dandy. Now the problem. Within this
    "Content" movie clip, i have another movie clip with a button in
    it. This clip is designed to tween in then upon clicking a close
    button tween out. When I test it the button doesn't have rollovers
    like and I can't get it to talk to the clip above it to play the
    close tween.

    > I am still struggling with the fact, that upon testing,
    buttons in movie clips
    > do not exhibit their various states. Up, Over etc. I'm
    relatively sure that you
    > can have buttons in Movie Clips. I've also noticed that
    any graphic symbols
    > within a Movie Clip produce the hand, when the mouse
    cursor is Over them, just
    > like a button would. All of this happens, when testing
    in the FlashPlayer.
    is there any place you could kindly upload the source file
    for me to check ?
    > Do buttons operate independently of the Movie Clip
    timeline they are placed in?
    that is correct, button should work independently to movie
    clip.
    it only react to mouse upon entering the HIT state (which is
    invisible to user)
    and stops reacting once the mouse is off that state.
    > I have one Movie Clip with a one frame time line, should
    a Button symbol work
    > it it?
    of course it should work...
    Try to upload the source, let us check it out for you, spare
    you time on guessing :)
    Best Regards
    Urami
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • Playing a mp3 when a movie clip loads

    I am using Adobe Flash Professional CS6
    What I am trying to do is play a mp3 file that I have in my library when the clip loads and stop playing it when the a new clip is selected from the menu I created.  On the button that loads the movie clip (Instance name: Slideshow), I have the following code:
    [code]
    on (release){
        gotoAndPlay(120);
    onClipEvent (load){
        mySong = new Sound();
        mySong.attachSound("MastersThisHall");
        mySong.start(0,50);
    onClipEvent (unload) {
        mySong.stop();
    [/code]
    - I went to the properties of the MastersThisHall.mp3 file in my library,
    - Selected the "ActionScript", tab,
    - Checked the box that says "Export for ActionScript",
    - Unchecked the "Export in frame 1" check box, and
    - Added MastersThisHall in the "Identifier" field.
    The sound is NOT playing when I when the "Slideshow" button is pressed.
    Ideas?

    Thank you for all of this; it is very helpful.
    I have series of 6 buttons I created, each of them load a different movie clip. I need to have the music from the slideshow NOT continue to play when a new movie clip is selected.
    I have the following code.
    Frame 1:
    SlideshowMusic = new Sound(this);
    SlideshowMusic.attachSound("MastersThisHall");
    stop();
    Frame 120 (attached to the Slideshow movie clip object):
    onClipEvent (load) {
        SlideshowMusic.play();
    The "Mute" Button:
    on (release) {
        SlideshowMusic.setVolume(0);
    The "Resume Sound" Button:
    on (release) {
         SlideshowMusic.setVolume(100);
    And the "Pause" Button:
    on (release)
      if (SlideshowMusic.position < SlideshowMusic.duration)
        SlideshowMusic.start(SlideshowMusic.position / 1000);
    It is loading and working perfectly. However, I have two more questions:
    1. How do I make the the sound automatically stop when a new movie clip is played?
    2. How do I change the "pause" symbol to the "play" symbol when the "Pause" button is pressed?

Maybe you are looking for

  • How to read and update the value of property file

    Hi, I am not able read the values from property file. Please tell me how to read and update the values from property file using Properties class This is my property file : - Config.properties its located in D:\newfolder Values SMTP = localhost Now i

  • Report for All the Billing Documents

    Hi, The SD report VF05 can only list for me billing documents belonging to a payer or a material but i want to extract all the billing documents of all the payers and all the materials. Which report can i use for that?

  • Plz plz help me out

    im trying to find out the selected node in jtree and open a perticular file from that location plz help me out ...

  • Active Directory "Invalid User name and password" but have joined before

    I have had a small handful of machine repeat the same thing. A workstation may still login but with an old PW, it will no longer authenticate to the domain. In times past I have been able to track the edu.kerberos.mit file and the directoryServices p

  • Can't Install After Effects CC or CS6 in New Macbook Pro 15inch

    Hi, Please, urgent help required. After Effects is not starting. Its installing, then saying this current version of After Effects v.12 is not compatible with my OSX 10.9.2 Mavericks. no problem with any other software. Its the first time ever someth