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

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.

  • 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

  • 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.

  • Photoshop cc generate assets doesn't resize all images correctly

    I have a stack of images, and I'm using Photoshop CC's new generate assets to produce two versions of each. One at current size (retina), one at half size (normal). Each layer I'm exporting has this naming format "[email protected], 50%image1.jpg".
    When I generate assets, not all 50% scaled images get scaled down. Some that should be half the size are the same dimensions as the retina version. Other images scaled down by 50% are correctly resized. It seems to be random.
    I have tried variations of scaling, 25%, 200%, renaming the layers, turning generate assets off then on, re-opening the psd, restarting photoshop. None of these seems to make a difference.
    Anyone else experienced this, or have a solution?

    I have a stack of images, and I'm using Photoshop CC's new generate assets to produce two versions of each. One at current size (retina), one at half size (normal). Each layer I'm exporting has this naming format "[email protected], 50%image1.jpg".
    When I generate assets, not all 50% scaled images get scaled down. Some that should be half the size are the same dimensions as the retina version. Other images scaled down by 50% are correctly resized. It seems to be random.
    I have tried variations of scaling, 25%, 200%, renaming the layers, turning generate assets off then on, re-opening the psd, restarting photoshop. None of these seems to make a difference.
    Anyone else experienced this, or have a solution?

  • 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

  • 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

  • Creating a logo in Pages - a way to save and resize?

    I created a logo in Pages using a few text box, some text and various shapes and colors. I created it at the largest size I think I'll be using it at (quite large, a few feet across) and now I want to use it in several other, smaller instances. I grouped it all together, but when I resize the box, the type stays the same size and so everything gets out of place.
    Is there a way in Pages to save an object such as I've created here, and be able to resize it in correct proportions etc, including any type use, so that I can use it in various sizes etc?
    thanks!

    Is there a way in Pages to save an object such as I've created here, and be able to resize it in correct proportions etc, including any type use, so that I can use it in various sizes etc?
    Save to disk as PDF Portable Document Format, drag from disk into design space (: Pages document), and apply geometric manipulations in Quartz imaging model including resizing, rotating etc etc.
    /hh

  • Aterm doesn't resize contents properly

    I've been on holiday for a while so recently did a large update (300+ packages). After doing it aterm has stopped resizing its contents correctly.
    It is hard to explain but if I stretch an aterm window larger the content (usually just a shell) doesn't always resize to fill the new window. Sometimes there is at least 5-6 blank lines at the bottom of the window that the content doesn't go in to. If I play with the size I can get the content into it but it seems to snap to a certain size before the content will fit.
    I'm running aterm version 1.00.01 on fluxbox and the shell is either bash or bash in screen.
    Has anyone else seen this kind of problem?

    If you open the brush dialog, there is a dual brush setting on the left that can be enabled. If you click on it, the dual brush diameter is the first option that can be changed and it is in pixels not %. If you resize your brush size with bracket keys or right click and drag the slider, photoshop adjusts this setting automatically, but the new drag resize leaves this setting intact.

  • Forcing a JWindow to pack/validate and resize

    Hi,
    I'm using a JWindow with some JComponents in it and I'm trying to set the font of this window and all of its components. After setFont() (which works) I want the JWindow to resize because the label sizes etc. changed with the new font.
    I tried JWindow's pack() and validate() methods but the window keeps its old now incorrect size.
    What can I do to recalculate the layout and to resize the window correctly?
    Thanks
    Frank

    Your example works for me, too. But when I try (nearly) the same in my application
    System.out.println(myPanel);
    System.out.println(myWindow);
    dialog.setFont(font);
    myWindow.pack();
    System.out.println(myPanel);
    System.out.println(myWindow);
    I get the following results:
    JPanel[,0,0,113x149,invalid,hidden,layout=com.jgoodies.forms.layout.FormLayout,alignmentX=null,alignmentY=null,border=javax.swing.border.EtchedBorder@1be1041,flags=9,maximumSize=,minimumSize=,preferredSize=]
    JWindow[win0,0,0,113x149,invalid,hidden,layout=java.awt.BorderLayout,rootPaneCheckingEnabled=true]
    JPanel[,0,0,113x149,invalid,hidden,layout=com.jgoodies.forms.layout.FormLayout,alignmentX=null,alignmentY=null,border=javax.swing.border.EtchedBorder@1be1041,flags=9,maximumSize=,minimumSize=,preferredSize=]
    JWindow[win0,0,0,0x-1,hidden,layout=java.awt.BorderLayout,rootPaneCheckingEnabled=true]
    The panel seems to resized but in strange way. When I make it visible it has the old size.
    myPanel is a panel in myWindow. I use myPanel from myWindow to show it in the ModalLayer of a dialog so one of myWindows panels has been added to the modal layer of dialog.
    Frank

  • What's the code for Scaling a MovieClip at Runtime?

    I can't believe how difficult it's been to find an answer for such a simple question.  I found a thread in this forum titled "How to Resize a MovieClip at Runtime?", but the code that was posted as an answer has been removed from the post.  WHY?!?!  Is it a highly guarded secret?!?!
    Anyway...I just want to know how to scale a movieclip at runtime with a drag function...and also while the parent movieclip already has a drag function active.
    Any help would be much appreciated.
    BTW...I've found a cure for death that also instantly makes you the richest person in the world with all the knowlege of the universe...
    It can be found here:

    onMouseUp and onRelease is usually (but not always) the same.
    you can use a scaling factor:
    var scaleFactor:Number = .3;
    mc.onPress=function(){
    resize_mc = this;
    startX =_xmouse;
    startY = _ymouse;
    this.onEnterFrame=resizeF;
    mc.onRelease=function(){
    delete this.onEnterFrame;
    function resizeF():Void{
    resize_mc._width+=(_xmouse-startX)*scaleFactor;
    resize_mc._height+=(_ymouse-startY)*scaleFactor;

  • HELP: S10, how to resize or create new partion

    anybody can help me plz...
    how to resize or create new partion
    thanks... 

    Hi and welcome to the lenovo forum,
    the quickstart itself will/ is install/ed in hidden folders on the windows partition. Installed as a normal program and de-/re-installable ,  its available in the download driver section .
    Next ..that used free software has no spy/nag or virus in  ..
    Important is Do as a first step ,  backup/save the whole hdd  on an extra media external hdd i.e.because changing position and size you could loose your recovery function...!
    Resize and Partition/correction will easy managed by partioning tool in windows after apply it restarts and do the action for you...  
    Aware you can loose with grub and linux install your  recovery feature ... quickstart is totally independed about that..so if that proggy is activated in BIOS/or windows ...and you have installed i.e. linux, see whats happen when you start ... start ...quickstart will comes first , you can use quickstart or ... if you didnt press any key while starting (boot-progress) it will go further, grubloader comes up now you can choose boot to windows or linux ...
    a triple multi system ...
    sincerely KalvinKlein
    Thinkies 2x X200s/X301 8GB 256GB SSD @ Win 7 64
    Ideas Centre A520 ,Yoga 2 256GB SSD,Yoga 2 tablet @ Win 8.1

  • Converting MovieClip to Sprite issue

    I was reading that you can optimize your Flash project by using Sprites instead of MovieClips if you don't need the timeline. So I right clicked on one of my MovieClips in the library and changed the Base Class from flash.display.MovieClip to flash.display.Sprite and it now has a green gear icon. I changed my variable declaration from var myThing:MovieClip to myThing:Sprite as well. But now all of my textfields and buttons in that Sprite are causing compiler errors:
    Access of possibly undefined property textfield_txt through a reference with static type flash.display:Sprite.
    Am I going to have clear all those textfields and buttons and re-add them in Actionscript? It would be nice if I could position them using the GUI.

    After some more Googling, this is my understanding of what is going on. Please correct me if I am wrong. Dot notation is for accessing properties, not for accessing children.
    dot notation can be used to access children added in the authoring environment.
    But the reason why myMovieClip.myTextField_txt works is because MovieClip is a dynamic class. Sprite is not a dynamic class, which is why all my previous dot notation failed when I tried to access my buttons and textfields of mySprite, which is a former MovieClip.
    correct.
    I was able to access my old buttons and textfields with SimpleButton(mySprite.getChildByName("myButton_btn")) and
    TextField(mySprite.getChildByName("myTextfield_txt")), but having to call getChildByName and casting them every time would probably offset any performance gains by converting my MovieClip into a Sprite.
    there are no appreciable performance gains obtained by using sprite instead of movieclip.  there are memory gains because a sprite occupies about 36bytes (<10%) less memory than a movieclip.
    The right way to do it would be to clear all my old buttons and textfields and re-add them with actionscript. Children of sprites are accessed directly, which is why mySprite.newButton.addEventListener doesn't work and just doing newButton.addEventListener does work. Is that about right?
    correct

  • Dynamically created Text field inside of empty Movieclip

    Hi there.
    My goal is to have a button that, when clicked, an empty
    movieclip is created and a text field is attached to it.
    I could write it easily if the newly created instance names
    where hard coded, the problem comes with the syntax to generate
    them dynamically.
    Here's the code i have so far:
    ActionScript Code:
    button.onRelease = function() {
    createText();
    var count:Number = 1;
    createText = function () {
    _root.createEmptyMovieClip("placeholder"+count,this.getNextHighestDepth());
    this["placeholder"+count].createTextField("my_txt"+count,
    this.getNextHighestDepth(), 100, 100, 100, 100); count++;
    After that's done i still need to assign a text value to the
    text field, which i have no clue on how to do it...
    In other words I want to accomplish something like:
    placeholder[count].my_txt[count].text = "my text";
    I hope it's not confusing... Any help would be greatly
    appreciated.
    Thanks in advance!

    if your createText() function isn't working the way you want
    check your use of "this" and "_root". if they're not the same,
    you're not referencing your newly created movieclip correctly. and
    your textfield depth isn't what you really want, but it should work
    ok.

  • CS5 tlf display issues

    I'm having lots of love working with the new TextLayoutFormat...
    The text was not displaying correctly when MovieClip holding a TLF instance would be resized, even after updateAllControllers...so I had to account for it by removingAllControllers first.
    The current problem occurs when I resize the MovieClip below the length to display the complete text and then later resize it to fit the text length. The TLF instance appears to compose the TextLines correctly (they report the correct length at least), but the MovieClip retains the width of the size that did not fit.
    Any help would be appreciated... 

    Apologies for not providing more info. Holidays were approaching and I got a bit scatterbrained.
    I've done the tests listed on that page and most of the stuff (internet connection, host file, global certificate, secure site access) checks out. The only issue is that I can't seem to connect to activate.adobe.com. When going through the browser, I am redirected to Adobe Systems Inc. - Access Denied with the following message:
    Access denied
    We're sorry, you are not allowed access to the service you requested.
    If you feel you should have access, please contact the appropriate authorities and give them your IP address: 174.103.182.131
    Thank you for your patience.
    I've tried to ping the server and it just gives a time out. I've tried accessing the activation server on two different networks and get the same result.
    I've also tried turning off anti-spyware, anti-virus and my firewall with no difference.
    Any other info that will help?

Maybe you are looking for

  • ITunes 7 gives error message when playing songs off ipod

    Whenever I connect my ipod to my computer and use itunes to play songs from it...it gives me the following message whenever a song plays. "iPod is in use and cannot be updated. The required file is in use." Does anyone know why this would be happenin

  • Even since I have been using mountain lion my Dreamweaver CS6 is not working.

    I have downloaded it again from Creative Cloud & also de-installed but it is just not booting at all from the icon in either the dock or applications. Please help?

  • Icons are gone in MyGtkMenu after gnome update

    Hello, the icons of MyGtkMenu disappeared after the gnome 2.28 update, does somebody have the same issue?

  • Automatic renewal payments

    I have a auto debit for my Skype number.  My subscription expired, I am having trouble renewing my number.  When I follow the skyp process it takes me to the Korean affiliate (I live in South Korea, but using an American bank account). The Korean aff

  • MSS Employee Profile

    Hello, We are implementing MSS on Portal. When a Manager views the Employee Profile for a particular employee and goes to Miscellaneous Tab -> Organizational Assignments -> History it shows the Manager's Communication information like Phone Number an