Finding the width of a JPEG loaded into a movie clip

I will be loading a page of bio information. Next to the
person's photo (photos will vary in width) I want to put a column
of buttons about 20 pixels to the right of the photo. So after I
load the photo into an empty movie clip, I'm trying to get the
width of the photo in order to figure out the x position of the
buttons next to it. Here is what I have:
myImage = "images/" + _level0.images[link];
loadMovie(myImage,image_mc);
// JPEG loads okay into image_mc //
trace("image_mc._x = " + image_mc._x);
// I get "Image_mc._x = 393" as expected //
trace("myImage._width = " + myImage._width);
// I get "image_mc._width = undefined" //
trace("image_mc._width = " + image_mc._width);
// I get "image_mc._width = 0" //
How do I find the width of the loaded JPEG?

you are probably trying to get the width before the image has
loaded completely.. use the MovieClipLoader class to load the image
into the empty movie clip, then use the onLoadInit event to get the
movie clips's width(which is the images width);
var mcLoader:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
myListener.onLoadInit = function(target:MovieClip):Void{
trace(image_mc._width);
mcLoader.addListener(myListener);
mcLoader.loadClip(myImage, image_mc);

Similar Messages

  • How do I find the URL for a document loaded into Buzzword?

    How do I find the URL for a document loaded into Buzzword?

    What kind of document? What is Buzzword?

  • Bitmap Font gets blurry when its swf is loaded into a movie clip

    I have a gallery i'm working on, located here:
    http://www.stationarynotes.com/portfolio/Gallery.html
    If you click the first button (the one that looks like a
    splattered "S" in black ink) you'll see that my bitmap text gets
    rendered all blurry. That swf which is being loaded renders fine
    when I test it by itself. The text is positioned with whole numbers
    and aligns to the grid within its own swf, and the movie clip which
    receives it is also positioned with whole numbers. Do you think
    perhaps when it is loaded into another MC it is being pushed off of
    the grid somehow...? I'm really confused.
    I can post my .flas if that'll help.

    bitmap fonts look best when positioned on a whole pixel
    number (100.0 instead of 100.4 for example).
    If you are loading into an empty clip - try placing that clip
    on the nearest whole number. or you
    could load the external swf to a level with will position it
    at 0,0 (upper left corner of stage).
    --> **Adobe Certified Expert**
    --> www.mudbubble.com
    --> www.keyframer.com
    Scruffpuff wrote:
    > I have a gallery i'm working on, located here:
    >
    http://www.stationarynotes.com/portfolio/Gallery.html
    >
    > If you click the first button (the one that looks like a
    splattered "S" in
    > black ink) you'll see that my bitmap text gets rendered
    all blurry. That swf
    > which is being loaded renders fine when I test it by
    itself. The text is
    > positioned with whole numbers and aligns to the grid
    within its own swf, and
    > the movie clip which receives it is also positioned with
    whole numbers. Do you
    > think perhaps when it is loaded into another MC it is
    being pushed off of the
    > grid somehow...? I'm really confused.
    >
    > I can post my .flas if that'll help.
    >

  • Can PDFs be loaded into a movie clip?

    I'm trying to make a bit of a digital magazine by taking PDFs
    of our print version and loading them into a flash movie where the
    user can flip through the pages pretty much like a photo gallery.
    Can I do this or will I have to convert them to JPGs and provide
    links to download the PDFs if they want to print?

    RevJaySprout wrote:
    > I'm trying to make a bit of a digital magazine by taking
    PDFs of our print
    > version and loading them into a flash movie where the
    user can flip through the
    > pages pretty much like a photo gallery. Can I do this or
    will I have to convert
    > them to JPGs and provide links to download the PDFs if
    they want to print?
    >
    need to convert to jpg, there is no load of PDF yet.
    Best Regards
    Urami
    "Never play Leap-Frog with a Unicorn."
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • How to load swf into a movie clip?

    i have an swf file i want to load into a movie clip within my
    flash file, i think im supposed to use loadmovie () instead of
    loadmovienum, can anyone help me out? thanks

    loadMovie("X",Y);
    Where x is: the url of the swf file you want to load.
    Where y is: the name of the movieclip you want to load it
    into. You must give the movieclip an instance name.
    For example, if I wanted to load '1.swf' into a movieclip
    with an instance name of "loaderclip," my code would be:
    loadMovie("1.swf", loaderclip);

  • Hi, dragging jpeg files into i-movie - the selection of jpegs is repeating certain photos and not featuring others, making the entire sequence impossible to view. PLEASE HELP!

    Hi, I have been dragging jpeg files into i-movie all week without issue. Now all of a sudden, the selection of jpegs I'm dragging is repeating certain photos and not featuring others, making the entire sequence impossible to view.
    Please help, this is urgent for a funeral tomorrow! It didnt happen with any of the other family tributes, they all worked fine.
    Many thanks,
    Ruth

    It worked! Thank you! I finally just finished about 20 minutes ago! It took over 26 hours to complete the process you described, but I stuck with it and it worked. I am glad I didn't give up or "forget it" as some might have suggested. That would have set me back until tomorrow!
    Ultimately, it turned out there were 45,910 jpgs created. No wonder it took so many hours to render/display them all. It ended up being about 10 hours before it seemed they were all rendered but the process between them displaying and being able to start really deleting them took a few hours because partly I was asleep and also partly it took forever to do anything. Any action as simple as selecting and right-clicking to Get Info, or emptying the trash, would take 20-30 minutes, a couple times longer. The clock stopped many times for 20-30 minutes at a time, a few times over 30 minutes, before catching back up. My cursor never froze which is what really kept me going, although it was a spinning beach ball for most of the time. I was never so relieved to see my regular cursor as opposed to seeing a spinning beach ball as I was early this morning after about 10 hours!
    Once I was able to open a Finder window and select all 45,900 files (I had already deleted 10 in the previous couple hours during experimenting of trying to figure out what would work best), then right-click and select to move all the files to the trash, the process of moving them to the trash took 4.5 hours. Then deleting them from the trash took a couple minutes. There were 21.4 GB!!! No wonder the whole process took 26 hours!
    mende1, thank you so much!

  • How do I find the size of my JPEG photos

    I want to find the size of my JPEG photos so I know how many photos I can fit per GB on my flashdrive.
    I know that my photos are in the "all images" section, on the left side  of my "Mcintosh HD" dialogue box, a box which contains just about everything in my computer.
    I click on "all images" and then a list of all my photos show up in the dialogue box. Then I can click on a photo and it will show the photo, but not the size of the photo. I would like to know the size of my photos, ie how may MBs per photo. (Let's say I find out a typical photo I have has 2.3 MBs. Then I can divide 1000 by 2.3 and that gives me the number of photos per GB in my flash drive.)  Thanks.

    I'm using iPhoto 11 Version 9.3.2
    Highlight or open a photo. In iPhoto 11, at the bottom right there is an i/info tab.
    Selecting info should give you a window similar to this.
    As for the difference in file sizes there can be a few possibilities.
    1) you may have periodically changed the resolution settings in the camera
    2) you may have resized/scaled or edited the original photos

  • I do not manage to find the function to change a letter into exposing. I have MUSE DC 2014.2 and the menu does not display this possibility. I tried to import it IN design but that does not function either?

    I do not manage to find the function to change a letter into exposing. I have MUSE DC 2014.2 and the menu does not display this possibility. I tried to import it IN design but that does not function either?

    I'm not clear on exactly what it is you're asking, but if you're referring to changing opacity, you can change the opacity setting for the States of a menu item via the States panel and Control Strip.

  • The .prel files will not load into premiere elements 13 and says that there is a missing codec. This is a school's site llicense that we've used for more thatn a month.

    The .prel files will not load into premiere elements 13 and says that there is a missing codec. This is a school's site llicense that we've used in our lab for more than a month.

    GPPNeil
    Premiere Elements 13 on Windows 8.1 (assumed 64 bit).
    First..
    1. Have you updated from 13 to the 13.1 Update using an opened project's Help Menu/Update. If not, please do so.
    2. Do the problems exist if you disable the antivirus and firewall(s)?
    3. Are you running the program as Administrator? Do you have the latest version of QuickTime installed on your computer?
    4. Have you refreshed the Online Services using Premiere Elements Editor Edit Menu/Preferences/Web Sharing?
    5. Have you updated the Adobe Application Manager?
    http://www.adobe.com/support/downloads/detail.jsp?ftpID=4773
    6.Is your video card/graphics card driver version up to date according to the web site of the manufacturer of the card?
    7. Lots more we could go through such as deleting the Adobe Premiere Elements Prefs file and, if necessary, the whole
    13.0 Folder in which it exists.
    But, I think that you have enough things going on here to warrant an uninstall, free ccleaner run through (regular cleaner and registry cleaner parts) and then reinstall with the antivirus and firewall(s) disabled.
    CCleaner - PC Optimization and Cleaning - Free Download
    If the problems persist after all that then we will adjust to additional troubleshooting maneuvers.
    Any questions or need clarification, please do not hesitate to ask.
    Thank you.
    ATR

  • How can I load an external SWF into a movie clip that's inside other movie clip?

    Hi.
    I creating my first flash (actionscript 3.0) website but I'm
    stuck with a visual effect I want to create.
    I have a window on my website called contentWindow. Every
    time you click a button this window is supposed to leave the stage,
    load the requested content and return to the stage.
    The sliding window is a movie clip with 83 frames, 21 to
    enter the stage, 21 to leave the stage again, 20 for nothing (its
    just to simulate the loading time) and 21 to return to the stage.
    Now my goal is, when the user clicks on a navigation button,
    the window exits the stage, loads an external SWF with the content,
    and then returns to the stage.
    I've the "window" movie clip with an instance name of
    "contentWindow". Inside there is another movie clip with an
    instance name of "contentLoader". The content that the user
    requested should appear inside the "contentLoader".
    Now, when the contentWindow leaves the stage, I get this
    error message:
    quote:
    TypeError: Error #1009: Cannot access a property or method of
    a null object reference.
    at rwd_fla::MainTimeline/trigger()
    If I switch
    "contentWindow.contentLoader.addChild(navLoader);" for
    "contentWindow.addChild(navLoader);" it works fine, but the
    external SWF doesn't move with the window.
    How can I load an external SWF into a movie clip that's
    inside other movie clip?

    Hi,
    Recently, I have been putting together a flash presentation.
    And I am just wondering if the following might help you, in your
    communication with the said swf file:
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
    onComplete);
    function onComplete(event:Event):void
    event.target.content.thinggy_mc.y -= 100;
    Not the best example, but this allows you to target a mc
    within an external swf file. I think if you look up this code, you
    will have an answer ;)
    Kind Regards,
    Boxing Boom

  • I am trying to insert a cut photo into a movie clip. the cutaway photo appears above the clip and cuts away when you move the curser across it, but does not show the cutaway when in playback. What am I missing?away

    I am trying to insert a cutaway photo into a movie clip. The cuaway photo appears over the clip and will appear in the clip when you manually moce the curser across it, but will not appear in the clip during playback. What am I missing?

    Try using the SHARE menu to share your movie in the sizes you need. It should work on the shared copy.
    Another thing to try would be to restart your Mac so you have fresh memory.

  • How do you combine two or more movie clips into one movie clip in iMovie '09

    how do you combine two or more movie clips into one movie clip in iMovie '09

    First create an iMovie project. Then drag the clips (or portions of clips) that you need into the project.
    When finished, use the SHARE menu to share the project.

  • How do I find the width of an external swf file that I am loading in

    I have loaded in an external swf file and it works fine.
    However, when I get the width dimensions of the movieclip that is housing the external swf file it gives me a '0' for the width.
    Thanks for your time.

    you must wait until loading is complete before trying to access the loaded objects width.  at that point you can determine the width,height of the onstage/backstage objects in frame 1 of the loaded swf.

  • Finding the width of a component

    I'm using the file below to load a series of images into a container named containerSprite. The size of each image will vary and I want to be able to calculate the width of the container so I can place navigation buttons relative to the position of containerSprite. My code does not work when the first image is loaded-- when I use trace("WIDTH="+containerSprite.width) I get 0 the first time through.
    How or where should I set up an event listener that will fire only when the image has finished loading.
    Thanks for helping me think through this process.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="init()" >
        <mx:Script>
            <![CDATA[
                import mvc.SlideShowTextView;
                import flash.display.*;
                import flash.events.*;
                import flash.net.URLRequest;
                import mvc.SlideShowModel;
                import mvc.SlideShowView;
                import mvc.Model;
                import mvc.View;
                import flash.text.TextField;
                private var slideModel:SlideShowModel;
                private var slideView:SlideShowView;
                private var textView:SlideShowTextView;
                private var req:URLRequest=new URLRequest("data.xml");
                private var containerSprite:Sprite;
                private var s:Shape;
                private var titleText:TextField
                private var numbersText:TextField
                private function init():void{
                    titleText=new TextField;
                    numbersText=new TextField;
                    containerSprite=new Sprite;
                    containerSprite.addEventListener(MouseEvent.CLICK, containerClicked)
                    s=new Shape;
                    containerSprite.addChild(s)
                    holder.addChild(containerSprite)
                    holder.addChild(titleText)
                    holder.addChild(numbersText)
                    slideView=new SlideShowView(containerSprite);
                    slideModel=new SlideShowModel;
                    textView=new SlideShowTextView(titleText,numbersText);
                    slideView.model=slideModel;
                    textView.model=slideModel;
                    slideModel.addEventListener(Model.MODEL_CHANGE, dataChanged);
                    slideModel.load(req);
                    titleText.x=0//containerSprite.x
                    titleText.y=500//containerSprite.y+containerSprite.height+10
                    numbersText.x=500//containerSprite.x+containerSprite.width-100
                    numbersText.y=titleText.y
                private function dataChanged(event:Event):void{
                    trace("WIDTH="+containerSprite.width)
                private function containerClicked(event:MouseEvent):void{
                    slideModel.setCurrentIndex(slideModel.currentIndex+1)
            ]]>
        </mx:Script>
    <mx:UIComponent id="holder"  horizontalCenter="-250" />
    </mx:Application>

    You will need to catch the Event.COMPLETE from each Image
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • Finding the width and height of an image

    Hi...
    i have a path to an image "images/me.gif" and i'm trying to find its width and height.. am trying to use javax.swing.ImageIcon but it refuses to recognise the constructor with just the filename (string) parameter, and needs a URL to the file... anyone knows what i'm doing wrong??? is this the wrong class that i'm using...!??!?!?!?!?

    String filename = "images/me.gif";
    Image myImage = carregarImagem(filename);
    System.out.println(myImage.getWidth(this));
    System.out.println(myImage.getHeight(this));
    * M�todo que carrega imagens na mem�ria, a partir da URL onde o
    * applet est� sendo carregado. O uso de um 'mediaTracker' � fundamental para
    * evitar problemas quanto � velocidade de carga de uma imagem. Se voc� n�o
    * usar um mediaTracker, o seu c�digo pode tentar usar uma imagem antes dela
    * estar plenamente carregada na mem�ria, o que causaria um erro de execu��o.
    * @param nomeDaImagem O nome da imagem a ser carregada
    * @return A imagem requisitada ou null caso n�o haja tal imagem na url do applet
    public Image carregarImagem(String nomeDaImagem)
                   try
                                   Image imagem = getImage(getDocumentBase(), nomeDaImagem);
                                   MediaTracker carregador = new MediaTracker(this);
                                   carregador.addImage(imagem, 0);
                                   carregador.waitForID(0);
                                   return imagem;
                   catch(Exception erro)
                                   erro.printStackTrace();
                                   System.exit(0);
                                   return null;

Maybe you are looking for

  • Officejet Pro L7780 Printhead Problem

    My printer is 2.5 years old and has light home use.  The printheads started failing...I had to run "clean printheads" before attempting to print anything.  HP Solutions said "Printheads OK."  Still, the printer was unusable. I bought 2 new printheads

  • Black screen during windows 7 install on 27inch iMac

    My iMac turns to a black screen during windows 7 boot camp install. I can use the install disk on my wifes Macbook Pro so I know that the media is good.

  • How to use SQL query in ADF

    Hi Team, I want to fire one sql query to retrive some data. I cant make VO of that query as its from many DB link. Query is like SELECT query. Can anyone suggest me My Jdev :- 11.1.1.6.0 Thanks In Advance Ramit

  • How to load data from sysbase to oracle using sysbase odbc drivers??

    Hi , I am trying to create an interface from sysbase to oracle, using LKM sql to orcle and IKM SQL control append, IKM SQL incremental append,CKM oracle . when we are running the interface we are getting below error com.sunopsis.sql.SnpsMissingParame

  • Mail: In 'classic layout' view the top header in mailboxes is grey.

    Hi, I am using Mail (version 6.0) in it's classic layout form. Since upgrading to OS X 10.8 I've noticed that the top header in my mailboxes is sometimes displayed in a grey font rather than in black, like the ones below it. Not that much of a proble