Resizing an image after loading

Hi.
I'm loading an image into a movieclip by loadMovie.
After i load it i want to resize it so it fits in a specific
place. The problem is that the resize doesn't work on it.
The code:
load_mc.loadMovie("image.jpg");
load_mc._width = 160;
load_mc._height = 90;
I even tried to use an onEnterFrame thinking that it wasn't
fully loaded by the time the resize started. Still doesn't work.
The picture is displayed but at it's full size. No resize
happens.
Can anyone help me resize it after it's loaded?
Thank you.

Thanks, that's really too nice. I was doing a little digging
on this - why
adding the function to the class works. Check it out:
var mcl = new MovieClipLoader();
trace(mcl._listeners.length);
you will get 1 - not 0. The class itself must be registered
as a listener by
default?
I'm not entirely sure. I dug a little through the Flash
classes, and while I
didn't find exactly what I was after I did find this within
the
EventDispatcher class' dispatchEvent method:
if (eventObj.target == undefined)
eventObj.target = this;
So, if there's no target the method would get called on the
class, as we
saw.
Dave -
www.offroadfire.com
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/

Similar Messages

  • Resizing of images after FCP update not working. When I try to resize, It resizes a blank transparent image.

    I am having trouble resizing images after I installed the FCP update. When I press the transform button, and then click on teh image, I go to the little blue dots on the side of the image that usually resize the image, and when I drag them out, instead of the image resizing, a black trasparent rectangle the same size as the photo expands outward to my desired size. This has happened to me before the update when trying to resize text, but the problem usually fixed itself once I clicked again on the text line in the editing section.
    Any ideas?

    Hi Russ,
    It doesn't work that way either, however it's okay because I solved the problem. Turns out I had to select 'add keyframe' on either the 'crop' or 'distort' tabs and it fixes itself. No idea why but the problem is solved! Thanks for your help anyhow.

  • How resize the image after drag drop according to container

    Hi,
    I have a image which can be drag drop in different size of containers. After drop i want to resize the image by maintaining the aspect ratio according to the container in which it is going to be drop. I will be very thankful for your help.

    thank you, brother
    i will try it see if it is work
    whatever, i will report the result later

  • How to correctly resize a component after loading using SWFLoader

    In an app, I load SWFs into an AIR app, which manages them.
    The AIR app loads the SWF, then creates a 'master' component, which
    manages the loaded SWF. 'manages' means resize, move or provide
    persisted preference values.
    My own test Flex SWFs work OK, while another SWF does not.
    Here's a screenhot:
    http://www.flexolero.com/demos/Portal/shot.png
    Note, that only some part of the loaded Clock resized
    correctly.
    The actual resize is done like this:
    quote:
    public function resize( newW:int, newH:int ):void {
    var loadedSM:SystemManager = SystemManager( ( _inner as
    SWFLoader ).content );
    if ( ( null != _inner )
    && ( null != loadedSM )
    && ( null != loadedSM.application )
    // BindingUtils.bindProperty( lblFromRemote, "text",
    loadedSM.application, '_outChannel' );
    // loadedSM.application[ 'inChannel' ] = 'New';
    loadedSM.application[ 'width' ] = newW-20;
    loadedSM.application[ 'height' ] = newH-20;
    this.width = newW;
    this.height = newH;
    _inner.invalidateSize();
    drawHandles();
    If the Air app finishes loading the SWF, the master component
    attaches a method to the managed SWF:
    (_inner as UIComponent).addEventListener( Event.RENDER,
    fixSizes );
    Actually, Clock sample does not resize as expected at the
    first time it appears.
    Once the Clock is on stage, and I resize it using the mouse,
    it resized as expected.
    Could someone provide a hint?

    maybe you need to calculate scaleX, scaleY instead?
    "justria" <[email protected]> wrote in
    message
    news:g8fbml$e7c$[email protected]..
    > In an app, I load SWFs into an AIR app, which manages
    them. The AIR app
    > loads
    > the SWF, then creates a 'master' component, which
    manages the loaded SWF.
    > 'manages' means resize, move or provide persisted
    preference values.
    >
    > My own test Flex SWFs work OK, while another SWF does
    not. Here's a
    > screenhot:
    >
    >
    http://www.flexolero.com/demos/Portal/shot.png
    >
    > Note, that only some part of the loaded Clock resized
    correctly.
    >
    > The actual resize is done like this:
    >
    >
    quote:
    public function resize( newW:int, newH:int ):void {
    >
    > var loadedSM:SystemManager = SystemManager( ( _inner as
    SWFLoader
    > ).content );
    >
    > if ( ( null != _inner )
    > && ( null != loadedSM )
    > && ( null != loadedSM.application )
    > ) {
    > // BindingUtils.bindProperty( lblFromRemote, "text",
    > loadedSM.application, '_outChannel' );
    > // loadedSM.application[ 'inChannel' ] = 'New';
    > loadedSM.application[ 'width' ] = newW-20;
    > loadedSM.application[ 'height' ] = newH-20;
    > this.width = newW;
    > this.height = newH;
    > _inner.invalidateSize();
    >
    > drawHandles();
    > }
    >
    > }
    >
    >
    > If the Air app finishes loading the SWF, the master
    component attaches a
    > method to the managed SWF:
    >
    > (_inner as UIComponent).addEventListener( Event.RENDER,
    fixSizes );
    >
    > Actually, Clock sample does not resize as expected at
    the first time it
    > appears.
    >
    > Once the Clock is on stage, and I resize it using the
    mouse, it resized as
    > expected.
    >
    > Could someone provide a hint?
    >
    >
    >
    >
    >
    >
    >

  • How can i resize my image after image trace?

    Hello all!
    I'm just now getting into using illustrator (currently on trial for illustrator cc) and I've taken a couple of my illustrations and attempted to use the image trace. The only way I can seem to get the image trace to actually produce an accurate trace is if I use a very large file size. So I take my scanned image (600 dpi 2000x 1891) and load it into illustrator, and here's where the problem comes in. Illustrator will not show my entire image on the screen. I zoom out as far as I can go and it's still cutting off the bottom and top of the image. When I try to scale the image it won't let me scale it down to even 90%.
    So my question, is there anyway I can load my full size image into illustrator, image trace it, and then scale it down so I can see the whole image on my screen? It's very hard to paint and work around the image when it's getting cut off.
    The first picture is what the whole picture looks like, but it's such a small file size it's blurry and won't image trace correctly.
    The 2nd image is what happens when I load my full image size in, I'm scrolled as high as the page will go and the top is still cut off.

    Hope this helps Trevor.
    There are other ways of doing this, but try this one.
    Menu - ‘Select all’
    Object - ‘transform’ - ‘scale’
    Dialogue box - click ‘uniform’ add number 1% to 100%, your choice
    Options - tick ‘scale stroke & effects’
    tick ‘preview’ to see results

  • Automated Resizing of Images in Photoshop Elements 9

    I recently upgraded my wife's Photoshop Elements from version 6 to version 9.  However, there is one feature from version 6 that seems to not work in version 9.  When she drags an image into a blank template (of any size), the image drags in to the template in the full size.  So if the images are three times larger than the template, she has to resize every image after she drags them in which is a pain for her.  Previously in PSE6, when she dragged the image into the blank template, the program would automatically resize the image to fit within the window.  Then she could resize the iamge if she needed to.  It seems that there should be a setting for this, but I am coming up with nothing.  Anybody know of a solution to this?

    You didn't say if your on mac or windows, so you may not be familar
    with the elements organizer. The following workaround works on windows pse9,
    if your on a mac it may also.
    1. In the elements organizer, select (highlight) the photos you want to use.
        (don't open the photos into the elements editor, just select them)
    2. Back in the elements editor, with the project bin open, choose
       Show Files Selected in the Organizer.
    3. When you drag the photos from the project bin into your document, they should resize
       similar to pse6.
       If they are still to big, step back one step in the undo history panel from Transform the Frame to Place.
    MTSTUNER

  • Movie clip resize not working when image is loaded

    Hello,
    I'm having some strange luck in building an image slide
    show. I load the image paths into an array from an XML
    page and then step through the array elements w/ forward and
    back buttons.
    I have an empty image clip on the stage where I create an
    empty movie clip inside each time a new image is loaded. I load the
    image into the second movie clip like this:
    [code]
    _root.picsPage_mc.mc_pic_loader.mc_individual_pic_loader.unloadMovie();
    _root.picsPage_mc.mc_pic_loader.createEmptyMovieClip(
    'mc_individual_pic_loader', 1 );
    _root.load_movie_and_stop(
    _root.picsPage_mc.mc_pic_loader.mc_individual_pic_loader,
    _root.photo_array[_root.photo_index].image,
    _root.picsPage_mc.mc_pbar, 'regular_load');
    [/code]
    The load_movie_and_stop function is as follows:
    [code]
    function load_movie_and_stop( target_mc:MovieClip,
    movie_clip_to_load:String, p_bar:MovieClip, action:String )
    mc_loader._width = 0;
    mc_slider_bar.mc_drag_pan._x = 0;
    if( action != 'simple_load' )
    p_bar._visible = true;
    p_bar.bar._width = 0;
    var mclListener:Object = new Object();
    mclListener.onLoadStart = function( target_mc )
    if( action != 'simple_load' && action !=
    'regular_load' ){ target_mc.stop(); }
    if( action == 'load_and_play' ){ target_mc.play(); }
    mclListener.onLoadInit = function( target_mc )
    _root.resize_movie_clip(target_mc, 160, 120, 250, 190);
    if( action == 'load_and_stop' ){ target_mc.stop(); }
    mclListener.onLoadProgress = function( target_mc )
    if( action != 'simple_load' )
    percentLoaded = Math.floor( (
    target_mc.getBytesLoaded()/target_mc.getBytesTotal() )*100);
    p_bar.bar._xscale = percentLoaded;
    p_bar.txt_percent = percentLoaded + "% loaded.";
    mclListener.onLoadComplete = function( target_mc ){
    p_bar._visible = false; }
    var my_mcl:MovieClipLoader = new MovieClipLoader();
    my_mcl.addListener(mclListener);
    my_mcl.loadClip( movie_clip_to_load, target_mc );
    }//___endFunc___
    [/code]
    After the image is loaded into the movie clip, I then resize
    the image to be a specific width.
    The image resizing is done w/ this function:
    [code]
    function resize_movie_clip(clip_loader_name:MovieClip,
    max_width:Number, max_height:Number )
    orig_width = clip_loader_name._width;
    orig_height = clip_loader_name._height;
    aspect_ratio = orig_width / orig_height;
    if( (orig_width > max_width) || ( orig_height >
    max_height ) ) // If either dimension is too big...
    if( orig_width > orig_height ) // For wide images...
    new_width = max_height;
    new_height = new_width / aspect_ratio;
    else if( orig_width < orig_height )
    new_height = max_height;
    new_width = new_height * aspect_ratio;
    else if( orig_width == test_height )
    new_width = max_width;
    new_height = max_width;
    else { trace( "Error reading image size."); return false; }
    else { new_width = orig_width; new_height = orig_height; }
    clip_loader_name._width = Math.round(new_width);
    clip_loader_name._height = Math.round(new_height);
    [/code]
    Now, 98% of the time this works perfectly, but there is some
    certain times where the image resizing is completely ignored and
    the image gets loaded as it's normal size.
    Can anyone see why the image sizing get's ignored in some
    instance?
    Thanks for any help,
    Clem

    Found the solution that worked (used ._xscale and ._yscale
    instead of ._width and ._height
    [code]
    function resize_movie_clip(clip_loader_name:MovieClip,
    max_width:Number, max_height:Number, center_offset:Number )
    if( (clip_loader_name._width > max_width) || (
    clip_loader_name._height > max_height ) ) // If either dimension
    is too big...
    if( clip_loader_name._width > max_width )
    _root.picsPage_mc.txt_test = "func if 1";
    clip_loader_name._width = max_width;
    clip_loader_name._yscale = clip_loader_name._xscale;
    if( clip_loader_name._height > max_height )
    _root.picsPage_mc.txt_test = "func if 2";
    clip_loader_name._height = max_height;
    clip_loader_name._xscale = clip_loader_name._yscale;
    else { new_width = orig_width; new_height = orig_height; }
    [/code]

  • I want resize the image and set position after retrieving from oracle datab

    How can I display image on web page after retrieving it from oracle database. Display is not problem but resize that image and position is very dificult .Please send me Guideline about blob object todisplay and resize it in web pages

    I tried to do the suggetion made by you but I was not able to solve the issue. I think I am close to it and with your help I should be able to resolve it. Let me explain you the brief about this issue.
    1. Another group uses Oracle Apex to load the images in to the database.
    2. I am fetching this data fron Oracle and displays in to Webpage using PHP.
    This is so far I tried. Please bear with me if I am doing anything wrong.
    1.I created program.php which calls the <IMG> as suggested by you.Snippet of the code is
    <div><img src="/oracle/image_story.php" alt="Image Stories" width="900" height="500" /></div>
    2. In the image_story.php, I used the following code.
    <?php
    $query = "SELECT *
              FROM IMAGE_STORY WHERE image_id = 50";
    if ($result = run_oracle($query, 'select')) { // Run the query.
         $num_results = count($result);
         if ($num_results > 0) {
         foreach($result as $row){
              $img = $row['DOCUMT']->load();
              header("Content-type: image/pjpeg");
              echo $img;
              //echo '<div><img src="'.$img.'" alt="Image Stories" width="900" height="500" /></div>';
    ?>
    When I run the program.php,Image is not displayed and it is showing as "X". To troubleshoot the issue,I run the image_story.php and echo $img is giving me the weird character like,
    "ÿØÿàJFIFddÿìDuckyPÿîAdobedÀÿÛ„          
    I used PL/SQL developer as a client to access the BLOB field from the database and in the HTML view, it is giving me the same output.
    Select * from image_story a where a.image_id = 50
    I am not sure the issue is with the MIME-TYPE,ENCODING or I am missing something here. I tried lot of Content-Type.
    Please guide me.

  • Onload event after all images are loaded in an updateContent area

    Hi Spry Folks!
    I load a template into a page with a lot of img tags inside
    it. Everything works fine.
    Spry.Utils.updateContent (...HTML wit lots of img tags...)
    But the loading takes a while so I would like to hide it
    until all the images are loaded. Now I need an event which fires
    after the loading bar in the browser is gone.
    The onPostLoad observer fires much to early, cause the code
    is long loaded bevore all the images
    (...addObserver({onPostLoad:...)
    Same with the window.onload event (...window.onload =
    showContent();...) fires much to early.
    The only thing which is working is placeing the function in
    the onload event of the body tag.
    Like:
    <body onload="showContent();">
    But there I can't use it. And there is now body.onload
    handler as far as I know there is only the windows.onload handler
    and I thought always this is the same event than onload in the body
    tag.
    Has anyone an idea? Is there a spry event I haven't found for
    exact this problem?
    Thanks for your help!
    regrads
    marcus

    Hello,
    U might want to look in to the SpryImageLoader.js that comes
    with the 1.6.1 download. It loads your images, and allows u put
    callbacks on them, and set priority of loading them.
    http://www.dbooth.net/photos/
    uses it to (expect don forgot to upload the
    SpryImageLoader.js thats why its not really working :P )
    But that will give the basic idea of how to use it.
    Spry.Utils.ImageLoader.(url, callback(needs to be a function
    or null), priority)

  • Images aren't completely visible after loading in Photoshop CS6

    I've been using CS3.  Without un-installing CS3, I installed CS6 . . . actually both 64bit & 32bit.  I had several problems when running.  For example, images often were not completely visible after loading . . . part of the image showed as transparent.  I could duplicate the layer & all was ok, with both the new & original layers.  This hasn't been a major problem, but is a nuisance & indicates that something is not right.  Several features even cause "Photoshop CS6 has stopped working".  Thankfully, I could always fall back to CS3 when a problem cropped up, altho' it was a pain having to save so often.
    I deactivated CS6 and uninstalled (via Control Panel).  I then re-installed, installed updates & re-activated . . . same problem when images load.  I just re-installed, so I haven't had a chance to test other things. 
    I've postponed installing Lightroom4, hoping to solve CS6 problems first.
    Any suggestions?

    I downloaded & installed Nvidia GeForce G210 driver.  Started CS6 . . . opened several JPG images . . . each was completely visible after loading.  That sometimes happened before, so I'm not completely sure it's fixed . . . time will tell.
    Now I have another (different problem) . . . The Type tool will not work.  I get "Could not complete your request because something prevented the text engine from being initialized."
    For what it's worth . . . each time I clicked to make the above Bold & italics  I got a Windows Internet Explorer message "Are you sure you want to leave this page?"
    EDIT . . . I rebooted (again) & everything seems to be working . . . EXCEPT the Windows Internet Explorer message "Are you sure you want to leave this page?"

  • Show image quality as like original image after resize in as3.

    Hi Guys,
    I am working on a Action Script3 project and i am showing images after resizing. I am using Bitmap and BitmapData manipulation for this but not getting image quality as like original image.  Please guide and help me with code that how can i do this.
    Thanks & regards
    Rangrajan

    How are you resizing? Normally, you would draw the original bitmap data into the new bitmap data, using a matrix to resize. To smooth scale, you need to use the smoothing option of the draw method. Here's a little sample that takes a library image and scales it to 500x500, using smoothing:
    var orig:BitmapData = new baseMap(); //library image
    var res:BitmapData = new BitmapData(500,500);
    var m:Matrix = new Matrix();
    m.scale(res.width / orig.width, res.height / orig.height);
    res.draw(orig, m, null, null, null, true);
    var c:Bitmap = new Bitmap(res);
    addChild(c);
    toggle the true to false in the draw, to see the difference...

  • After loading Lion I cannot open some pictures. I get Unsupported Image Format. It tells me picture was taken with Canon EOS Rebel with unknown lens

    After loading Lion I cannot open open some pictures in Aperture. I get Unsupported Image Format, all files even the ones I can open are .JPG. Also it tells me picture was made using Canon EOS Rebel with unknown lens.

    You mention that 'most' of your files are DNG. Try
    running the effected files through Adobe DNG
    converter again and then import your reprocessed
    files to Aperture and see if the problem persists.
    I had a problem with a batch of D2x files converted
    to DNG which had been metadata tagged by
    PhotoMechanic (the evil app).
    B.T.W. You mention that you had been using Bridge.
    Are you getting any of the embedded XMP metadata
    coming into Aperture during the import process?
    Already tried that multiple times...no luck. I'm wondering though if it might be related to metadata as you suggest. I'm still trying different things to see what happens.
    I was able to alleviate the problem on one set of images by painstakingly searching my external drive for the oldest backups I could find - CR2 files from before DNG conversion. I then ran those through DNG Converter and tried importing them again (this time, I embedded NO thumbnail, but I'm not sure if that made the difference - I think it was more likely a fluke in the original conversion that caused the problem). This time, it worked.
    Now, the big problem is that I still have a couple hundred images for which I can't seem to locate the original CR2 files. I don't typically keep them after conversion, as I don't have the space for both.

  • AIR App Crashes iOS After Loading Remote Image

    I have had this problem both with the latest official AIR SDK 3.3 (3.3.0.3670) and 3.4 release (3.4.0.2540) when doing a Standard build.  I am loading a few files one after the other from a remote server on an iPad.  After loading some xmls and swfs successfully, my app crashes and closes without any error message upon loading an image file (I've tried both png and jpg with the same result).  I have both progress and complete event listeners on the loader and the crash happens after all bytes are loaded and before the complete event triggers.  So it seems as if there is some problem with initializing/decompressing the image.  The crash log reports things along the lines of "EXC_BAD_ACCESS" and "KERN_INVALID_ADDRESS."
    This problem does not occur if the files are loaded from the application directory --- only when they are loaded from the remote server.  It is also not occuring with the preview AIR SDK 3.4 with iOS6 Support release (3.4.0.3010).  It is also not occuring on the desktop simulator (adl) or the Fast mode debug option.
    Right now all I can gather is that it is a bug with the AIR SDK that seems to be resolved in upcoming versions, however I am due to submit my app to the app store September 4th so I don't really have the time to wait!
    Please advise on how I can go about tackling this issue.
    The issue occurs with any combination of the following:
    Flash Builder 4.6
    Flex SDK 4.5.1 or 4.6
    AIR SDK 3.3 or 3.4
    iPad 1/2/3 with iOS 5.1.1

    Hi,
    Could you please consider it raising via bugbase.adobe.com and share the bug number here for reference. Also, we would request you to attach sample source files which can replicate the issue.
    -Thanks for reporting it.
    Pahup

  • GPU acceleration disabled after loading image

    I recently purchased Photoshop CS6. I've installed on Windows 7 and run updates. I've also today updated my graphics drivers to latest version (catalyst 12.8). I have an AMD Radeon HD 7700 which has 1024MB RAM. This card is on the list of supported cards.
    When I first load Photoshop I can look in "Preferences -> Performance" and see that the GPU has been detected correctly and 'Use Graphics Processor' is ticked.
    However after loading any image, including using "File -> New" to open an blank white image, the GPU is disabled. Looking back in "Preferences -> Performance" it tells me:
    "no gpu options available with photoshop standard"
    What can I do about this?

    I have notified AMD.  It wouldn't hurt for you to do so as well - the more people who report problems with using Photoshop to them the more likely they are to take Photoshop users seriously, rather than just worrying about gamers.
    See also: http://forums.adobe.com/thread/1051662?tstart=0
    -Noel

  • Images suddenly disappear after loading. how can I fix this?

    Recently I had a problem with my proxy setting and I reset my Freegate settings.
    After that something bad happened. Whenever I search something is Google image and load an image in new tab, it takes a little time to load the image completely but right after that the image disappears.
    Sometimes suddenly a tab opens and says that my player setting should be updated; but when I download the "player-setup.exe" file, it quickly disappears from that folder! Once I could copy it before disappearing, but when I clicked on it, an error occurred that "it's not a valid application".
    My Firefox is the latest version. But I also have other problems with it and I don't know why.

    This smell like you were trying to safe malware, so it might have been your AV software that noticed this file and removed it to prevent infection.
    If you get a pop-up message asking to update Firefox or plugins then such a message is likely a scam and you should never respond to such an alert to avoid getting infected with malware.
    *Only update Firefox via "Help > About" or by downloading and installing Firefox from the Mozilla server and never via a pop-up or link on a web page.
    *Plugins should only be updated via the plugin itself or by visiting the home page of the plugin.

Maybe you are looking for

  • XML Publisher Version Mismatch Issue

    Hi, I am using XML Publisher 5.62 and deploying in XML Publisher 4.5 Server, for a standard Invoice report using XML Publisher. The requirement is that i have to have a logo and some invoice header details repeating for every page ,then ofcourse foll

  • Removing a 2003 DC and replacing it with 2008R2 DC

    hi all.  i have been doing a lot of reading and think i know the correct process, i just wanted to double check with the community. we have 2 DC's in our environment DC1 and DC2  DC1 is 2008r2 and hosts ADDS/DNS/DHCP/GC and all FSMO roles DC2 is 2003

  • Intra-company sale and purchase between two plants

    Hi All I would like to know how can intra-company sale and purchase be carried out in SAP? Details of scenario: There are 2 plants under one company code which are represented by 2 diff profit centre. When plant u201CAu201D requires component, it rai

  • What happened to the Twilight Zone TV shows???

    There were there a few weeks ago, and now they've been pulled! Anyone know what happened?

  • How to delete SMS attachments from IOS 6.0

    Does anyone know how to delete SMS attachments from the iPhone - They are still located on the phone after the messages associated with them have been deleted.  I am sure that previous versions of IOS deleted the attachment when the message was delet