Resizing a MovieClip's contents

I'm loading an external swf into a movieclip (the external
sfw plays a
slideshow of JPEGs). When the slideshow plays, the JPEGs
extend way beyond the
bounds of the movieclip. How would one go about constraining
the JPEGs to
their original size and centering them on the stage? And
where would one
place the actionscript using AS2, on the movieclip itself?

OK - for anyone that may need it - I played a bit and got it to work:
var mediaDirList:File = File.documentsDirectory;
mediaDirList = mediaDirList.resolvePath("tester/");
mediaDirList.getDirectoryListingAsync();
mediaDirList.addEventListener(FileListEvent.DIRECTORY_LISTING, directoryListingHandler);
function directoryListingHandler(event:FileListEvent):void {
    var list:Array = event.files;
    for (var i:uint = 0; i < list.length; i++) {
        trace(list[i].nativePath);
This seems WAYYY simpler than some of the solutions I looked at, so I'm wondering if it's best practice - it would work cross platform, right?
Thanks (forgot my manners in the last post).
Shaun

Similar Messages

  • Loader content got vanish on resize root movieclip

    Hello,
    I have made 30 dynamic movieclip and I put all these Movieclips in MainMovieclip, each movieclip loads one jpg image dynamically, when i resize root movieclip then
    all graphics got invisible. How can i resize parent movieclip, I can't resize individual loader content because there is complex thing will happen where i need to calculate x y position and height widh for individual,so that i put all movieclip in root moviclip and I resizing root movieclip.

    You likely already solved this issue...
    As I understand it, X, Y, width, and height are only read from the first frame of a loader object. Check to make sure that the content on the first frame of your object that your loading is the same size as the content of the entire object. In other words, if you have content on frame 50 that's 200 px wide in total from the registration point of x=0 y=0, and your content on frame 1 is only 100px wide, you'll need to add a transparent object on frame one (starting at x=0 y=0) that is also 200 px wide. If I understood your issue correctly, this should solve the problem. You can easily do a trace on the size of the object your loading to be sure that it's sizing correctly.

  • How can I resize a pdf page content with annotations and highlights in Acrobat Pro?

    How can I resize a pdf page content with annotations and highlights in Acrobat Pro while maintaining page size and annotation/highlight interactivity? I've tried to use the crop tool in Acrobat Pro (9) and the page does resize, but the highlights and annotations go all over the place. I specifically need to scale the page content smaller (83%) but maintain page size and annotation/highlight to content connection and interactivity.

    An old trick (not recommended) would be to print to a new PDF with the page size selected but a scaling of the content. Only print the document, not the markup, to a new PDF. Close that PDF when done and reopen the old one (or maybe a copy of the old one for safety) and use Document Replace pages and select the new document to replace your current pages. You will then have to go back through the markup to locate it all correctly. There may be a more elegant way, but this may be the fastest.

  • MAIL - Resizing Window Causes All Content to Vanish?

    This just started today. When I open MAIL, all is fine. When I try to expand or shrink the MAIL window from the lower right corner, the window resizes, but all the content vanishes and the entire window turns white as soon as I start to drag. The only way to get the MAIL content to reappear is to quit Mail and relaunch?
    Any ideas?

    Just to double check, you're using the Mail.app that came with the system, or a different mail program?
    Does this behaviour happen with other windows (ie Finder, Safari, etc)?
    I'm guessing you've rebooted...
    Try it in safe mode (turn on the computer and immediately hold shift... release shift after you see the apple/gear and a progress bar).  If it doesn't happen there, consider removing all login items (apple >> system preferences >> users and groups >> login items), rebooting, and try again.  Make a note of what login items you had in case you this doesn't work and you want to return them.  If it happens here, too... then...
    If you have an IMAP mail account, create a new user (apple >> system preferences >> users and groups >> click +) and setup mail in a test account and see if it does the same thing.
    Try that for starters.

  • Resizing and scaling all content to the artboard

    Hi
    I have about 150 files of various sizes. They all have different content and need to be resized to 5cm x 5cm (2.5in x 2.5in) so they can be compatible with an online system of mine.
    I have succesfully made a script that opens every file in the directory with the files, then resizes their artboard to my required size. Thats part of the manual labor taken out of the job.
    But how do I make the script resize and scale all content to the artboard, irrespective of the size of the content initially? Similar to how you might scale an image in Photoshop? I've seen bits and peices of code around that can resize and scale text objects and the like, but what about all content in the file?
    Robbie

    She needs to sync her phone to HER account on HER computer with HER iTunes library. Syncing with YOUR iTunes library does exactly what you described. By design.

  • Resizing a movieclip correctly?

    I can't figure out how to resize a movieclip correctly. I'm
    trying to make a photo gallery and keep everything a certain size
    but when I try and change the scaling, the movieclip just
    disappears.

    use:
    var pic:Loader;
    var totalImages:int = 10;
    var border:uint = 10;
    var prevX:Number = 0;
    var prevW:Number = 0;
    var i:uint=0;
    var container:Container;  // create a class for your container moviecip
    loadF();
    function loadF(){
        container = new Container();
        addChild(container);
        pic = new Loader()
        pic.load(new URLRequest(myImages))
        pic.addEventListener(Event.COMPLETE, resizeContainer)
    function resizeContainer(e:Event):void{
        container.x = prevX+prevW;
        container.width = pic.width+border;
        container.height = pic.height+border;
        container.addChild(pic);
        pic.x=pic.y=border/2;
        prevW=container.width;
        prevX=container.x;
        i++;
        if(i<totalImages){
            loadF();

  • Resizing parent movieclip without affecting the children

    Hi all,
    What's the best way of  resizing parent movieclip without affecting the children?
    I have a container movieclip that resizes depending on the stage, and when I add another movieclips to it they also resize, but I want them to keep the original size,
    is it possible?
    Many thanks

    Hi, thanks for the reply,
    I already tried this way, I put a bitmap as a background of the movieclip and made only it dependent on the stage size,
    something like that:
    mc.bg.width = stage.stageWidth; (and not mc.width, as its width will change along with the bg width)
    so when I add children to the mc, they don't change any more.
    I'm a .NET developer and new to Flash platform, and I think it would be nice from the community to make a built in property for MovieClip class -
    resizeChildren: Boolean
    I lost a whole day on this problem, because when I drew a movieclip in a designer side I saw that its background size changed along with the size change, and when I added children to it from the code the movieclip's size changed and the background stayed still, quite strange behavior for an HTML guy
    I think that it would be better to consider already drawn movieclip not to have any children yet and have its background as its part (not at(0)) and let the programmer choose later added children's resize behavior.
    thanks again

  • MovieClip(scrollpane.content).gotoAndStop(2);

    I need to get my main swf A to tell the swf B (swfB is my scrollpane content or source) to gotoAndStop at frame 2 but it doesn't communicate. 
    Here is my code on my main swfA:
    function xbutton (e:MouseEvent):void {gotoAndStop("p1");MovieClip(sp.content).gotoAndStop(2);}
    button.addEventListener (MouseEvent.CLICK, xbutton);
    Here is my code on frame 2 in swfB:
    stop();
    SoundMixer.stopAll();
    to better visualise what i am doing; swfA is my website with lots of pages, swfA has one page* that holds my scrollpane, inside my scrollpane is swfB with a flPlayback (*this page is the tv page). when I exit the tv page to another page on my website the tv must stop. swfB has my flPlayBack on frame 1, frame 2 is blank (no tv). Ps: The code in swfB works fine independently! I know this because tested it by adding a button (when pressed it goes to frame 2 and the code does stop the tv).

    Hi Ned,
    sp is on the same frame as the code on the main time frame and as I have mentioned I have tested the code internally within swfB and it works! but controlling swfB from swfA does not work. my identifying mark is SoundMixer.stopAll(); which stops all sound. As my post says sp is only on one frame of my site so seen as MovieClip(sp.content).gotoAndStop(2); happens when I click a button to switch pages a visual identifying mark would not be appropriate.
    still, why does this not work?

  • Resizing/moving MovieClips to fit screen problem

    I'd like to make an Android and iOS app with Adobe AIR, but I found a problem I can't solve.
    The Flash document size of the app is 800px x 600px, and I'd like to resize MovieClips to fit Android's and iOS' screens, suporting the Retina display on iOS devices.
    I tried using StageDisplayState.FULL_SCREEN and StageScaleMode.SHOW_ALL, and this does seem to work with static MovieClips, so the snippet would look something like this:
    import flash.system.Capabilities;
    import flash.events.Event;
    import flash.display.StageScaleMode;
    import flash.display.StageDisplayState;
    stage.addEventListener(Event.ENTER_FRAME,process);
    var difN:Number = (((stage.stageHeight*stage.fullScreenWidth/stage.fullScreenHeight)-stage.stageWidth)/2);
    function process(e:Event):void {
              difN = (((stage.stageHeight*stage.fullScreenWidth/stage.fullScreenHeight)-stage.stageWidth)/2);
              stage.scaleMode = StageScaleMode.SHOW_ALL;
    stage.addEventListener(KeyboardEvent.KEY_UP,useFullScreen);
    function useFullScreen(e:KeyboardEvent):void {
              if (e.ctrlKey) {
                        switch (e.keyCode) {
                                  case Keyboard.M:
                                            stage.displayState = StageDisplayState.FULL_SCREEN;
                                  break;
    obj.x -= difN
    However, I'd like to use classic tweens in my application, and this won't work since most of the elements are moving.
    I'd like to rescale/move MovieClips so they don't look distorted and every moving item moves correctly, showing all the content and trying to not make any borders. I read this article but it seems like it doesn't support classic tweens: http://www.adobe.com/devnet/air/articles/multiple-screen-sizes.html.
    Thanks for the help.

    1. scaleMode only has an effect when you embed your swf in an html AND you publish for a percentage.
    2. you need to resize your displayobjects using code and/or in the ide.  if you open your document settings panel (modify>document) and change your stage size you are offered some scaling options.  see if any work for you.

  • Problem resizing application in SWFLoader content in DividedBox

    Hi all,
    I have some strange behavior in my application. I am extending the plugin system as described by Chris Cantrell, the problem I have might be of more general nature though.
    http://blogs.adobe.com/cantrell/archives/2010/03/extending_air_applications_with_plugins.h tml
    I am loading a plugin (which is a WindowedApplication compiled to an .swf file and loaded via a SWFLoader) into a NavigatorContent within a ViewStack within a DividedBox. I am using pure AS3 files for logic and mxml skins for the GUI layout.
    When I resize the main application window, the SWFLoader.content.application is resized twice (Resize Events seem to come from WindowedApplication window_resizeHandler (first) and setStageWidth (second)) in the main application window. The first event seems to return the correct size, the second seems to ignore the size of the other content Containers in the DividedBox and returns a stage width equal to the width of the DividedBox part that contains the SWFLoader, which also resizes the whole window to that size again.
    When I only move the BoxDivider of the DividedBox nothing actually happens to the size of the SWFLoader.content.application.
    I tried using some manual Bindings via BindingUtils to set NavigatorContent.width, SWFLoader.content.width and SWFLoader.content.application.width but no success. Any Ideas how I could force the components to the right size, first when resizing the main application window, second when moving the BoxDivider?
    Thank you,
    rob

    postet my workaround here
    http://lifesdev.blogspot.com/2011/02/resizing-dynamically-loaded-swfs-using.html

  • Resize a native window content mantain the aspect ratio..

    Hello,
    I'm using this code top open a native window and load an external SWF into it.
    var tableWindow:NativeWindow;
    var options:NativeWindowInitOptions = new NativeWindowInitOptions();
    options.systemChrome = NativeWindowSystemChrome.STANDARD;
    options.type = NativeWindowType.UTILITY;
    tableWindow = new NativeWindow(options);
    tableWindow.title = 'MyWin';
    tableWindow.width = 600;
    tableWindow.height = 500;
    tableWindow.stage.color = 0x000000;
    tableWindow.stage.scaleMode = StageScaleMode.NO_SCALE;
    tableWindow.stage.align = StageAlign.TOP_LEFT;
    tableWindow.addEventListener(NativeWindowBoundsEvent.RESIZING, resizeDisplay, false, 0, true);
    tableWindow.addEventListener(Event.CLOSE, closeWin);
    tableWindow.activate();
    after opening a window i load the swf into it:
    var loader:Loader = new Loader();
    var context:LoaderContext;
    context = new LoaderContext();
    context.allowCodeImport = true;
    context.applicationDomain = new ApplicationDomain();
    loader.load(new URLRequest("app:/myswf.swf"), context);
    loader.contentLoaderInfo.addEventListener(Event.INIT, loadFlash);
    I have several problems.. if i use a ScaleMode different than NO_SCALE in main swf and/or in the loaded SWF the file is shown wrong. I have a correct window but the swf is displayed HUGE into the window.. so i've decided to use NO_SCALE as ScaleMode
    Is there a way to mantain the aspect ratio of the window AND (more important) resize ALSO the swf loaded into it?
    Thank you

    I rarely do Flex but I've done a lot of AIR for AS projects and I find their windows to have this bizarre behavior as well.
    I think 2 things are important in my limited experience. To keep aspect ratio I set it to NO_BORDER. This maintains the aspect ratio but also allows resizing.
    Second on my main class I explicitly set the main SWF to a height and width:
    e.g.
    package yada {
         [SWF(width=xxx,height=xxx)]
         public class MyApp extends.....
    If I didn't set that in the AS3 code explicitly (the XML didn't matter at all) the SWF would be the original size. Now your content should be at the size you specify in your window and allow resize.
    Lastly, you're already paying attention to resizing:
    tableWindow.addEventListener(NativeWindowBoundsEvent.RESIZING, resizeDisplay, false, 0, true);
    I think you need to handle that manually. As the user intends to grow or shrink the window you need to override their resize and set the height and width explicitly based on what they try to do, forcing the outer windows size to always be a proper aspect ratio.

  • CS4 - Resizing both frame and content in "width" transform palete...

    We need to resize placed picture, but both frame and content at same time with writing exact dimension in "width" transform palete. Problem is that only frame is resized. If we select picture with direct selection tool, only content is resized.

    Wrong field. Select the frame and use the scale fields to change the size of frames together with the content. This behavior was introduced in CS3.
    Plain numbers in those fields are interpreted by default as percentages, but you can enter exact dimensions of your choice by specifying the measurement unit after the number.

  • Why do iMovie clips automatically resize when I add content

    I recently added content to my iMovie project on my Macbook Pro and many of the other layered videos, photos, transitions, etc, resized themselves!  Why does this happen and can I revert or avoid this in the past?  Trying to avoid double work.
    Thanks

    When you say "resized" do you mean that the clips actually change their duration or just that they change in terms of how the clips are displayed in the project viewer?
    You can control the scale of the clips in the project viewer by dragging the little slider in the loweleft of the project viewer.
    Matt

  • Resize a movieclip at runtime

    I'd like users to be able to drag out a shape from the side
    of the stage (say a square) and then resize it on the stage. I
    think I've seen this Flash functionality somewhere on the web, but
    I can't figure out what the code would be for this. Can anyone
    help?
    Thanks,
    Michael;

    I think I've got the problem solved, but can I follow up on
    one thing you mention below? It has to do with the parent/child
    relationship and the startDrag action. I was under the impression
    that if I put a movieclip inside of another movieclip and then
    apply a drag action to the parent movieclip, then there was no way
    to access the child movieclip. For example, I put a small textInput
    component inside of a larger movieclip and then I put a drag action
    on the movieclip. I wanted users to be able to type in some text
    into the middle of the movieclip and then move the moviecip around
    if they wanted to. However, as soon as I put the drag action on my
    parent movieclip, the inputText component could no longer be used -
    the "hand" appeared over whole movieclip so users could no longer
    type anything into the inputText area. Is there any way to do what
    I want to do here?
    Appreciate your help!
    Michael

  • When i resize my browser my content goes all over the place?

    I have made a new page on muse. It is complete and i like the way it looks but when i resize the browser my images and content move around and it doesnt align like i want it to. It needs to lign up with the background image. How do i get the content and images to stay where they are and not move when i resize my browser? My other pages do this just fine. If anyone can help me out that would be great!

    In general the site appears to being working normally in a desktop browser. However the content on the page is too wide for many site visitors. (At ~1600 px it's too wide for my 15" 1440 pixel Mac display.)
    The "lines2.png" is 1900 px wide and thus makes the content area of your site 1900 px wide. When a site is loaded in a mobile browser, the browser will zoom out so the content area fits in the width of the device.
    Given your current design I think you want to set the page with in Site Properties to roughly 1200 pixels (it looks like it's currently 960, but your main header sticks out on both the left and right so you probably want to make your page large enough so the full header fits).
    For the lines, perhaps I'm missing something about the precise appearance of the lines, but it seems this could just be a Muse rectangle with only the top and bottom stroke weights set (left and right strokes set to zero in the Stroke panel, click on the word Stroke in the Control Strip). If a Muse rectangle is dragged so its left and right edges are both at the left and right edge of the browser area, then the rectangle will automatically change width in the browser to always be the full with of the browser window (and there won't be another http request to download a .png for the lines, as there is now).

Maybe you are looking for

  • Smart Form - operator not followed by value

    Hi all, in smart form --> Global definition --> initialization i have written this code.... select belnr gjahr bukrs blart bldat budat waers into corresponding fields of table tbkpf from bkpf where bukrs = ubukrs and gjahr = ugjahr and budat in ubuda

  • My recent iTunes purchases are not on my external hard drive (my pc crashed) can I get these purchases recovered?

    My PC (aka POS***) crashed and I knew it was going to happen sooner rather than later, so I backed up my music onto an external hard drive. I failed to back up my music regularly and I have lost a month's worth of purchases. Is there any way to get t

  • RE: GenericRepository supplier library? no...

    ToolInterpreter library could help. example : (You also need access to private and internal components) lom:qqrt_4gllom=qqrt_4gllom(task.part.lom); // build date deployDate:datetimedata=new; deployDate.setvalue(qqsp_datetime(lom.builddate)); // scope

  • Understanding counters/pulses/timing

    Hello everyone, I have slowly but surely been working on a closed looped forced controlled bioreactor for some research and have gotten stuck trying to understand how to utilize a output pulse/clock to control my stepper motor. Basically iam going to

  • EBCC inconsistant behavior

    I copied the security.wf from the OOTB stockportal application (portal 4.0 sp2) and added into my own project. Open it the first time in EBCC, the login node has an empty stub called button.login which is not linked to anywhere. Second time open it i