Presumably simple - adjusting MovieClip on stage resize..

Hi there!
I've been looking at a number sites lately and I've noticed that when you scale the browser window, what I presume must be a MovieClip, containing thumbnails, is adjusted, according to the size.
Two examples are these:
http://www.daniagraibe.com/
http://www.aorta.se/
When you go on these sites, thumbnails will eventually load - when you resize your browser window, more of less thumbnails will be on each line - according to how wide the browser (or stage, is).
I presume this must require a stagelistener of some kind?
If anybody has any clue how, using ActionScript 3, and instance names, this could be achieved, I'd really appreciate your help/advice!
Thanks in advance for anything you can provide!

Thank you for your reply - really appreciate it!
Would it really be this complicated though?
In the case of daniagraibe.com, it seems a little complicated for all those MovieClips to be repositioned, individually?
Or would it perhaps have internal thumbnails and work by:
calculating stage.stageWidth
seeing if it's > a number
If it is > a number, reposition thumbs
If < number, don't?
Thanks again for your help, if you're not sure on this, however.

Similar Messages

  • Cannot add movieclip to stage

    Hi, I cannot add movieclip to stage. Here's the code:
    package
        import flash.display.*;
        public class Game extends MovieClip
            private var s1:ScrollPlatform = new ScrollPlatform();
            public function main()
                addChild(s1);
                s1.x = 0;
    I have this in the first frame in the timeline:
    var game:Game = new Game();
    game.main();
    Please help. I am a newbie.

    You class Game has no contractor. You must have:
    public function Game():void {
    Perhaps your function main() is meant to be Game()
    Then either set Game as your document class (Game becomes your main timeline), or create an instance and add to the stage:
    var game:Game = new Game();
    addChild(game);

  • Stage Resizing on "Clicked" External SWFs

    Hello everyone!
    Thanks for checking this out.
    This has been bugging me for almost a week now. I hope I may find some assistance here. I've Googled for this and everytime I encounter an article with the solution and people saying it worked great for them, I thought it's going to help me too, but didn't. I'm pretty sure I did exactly what was instructed but mine is just weird.
    I hope you can try to look at my files and see what's wrong, anyway this is just a simulation of my real project (which has the same problem) at a very small scale so it should be very easy to look at. I believe it's so easy to solve but I just couldn't nail it. Here's a brief description:
    There's this main.swf that loads two external swfs in a UILoader upon click of the corresponding button. By the way, the code inside the external swfs listens for a stage resize... So, when user clicks on button 1 (named "LOAD 1"), it loads "content1.swf". User decides to resize the window, and layout resizes accordingly (in this case, they all center horizontally). User clicks on button 2 (named "LOAD 2"), it loads "content2.swf". Everything looks fine, apparently. But when user tries to resize the window again, an error pops up in the Output panel...
    Honestly, I've built a new one here at my desktop using var loader:Loader = new Loader(); concept instead of the UILoader Flash component but still no luck. Please, hear me out. I don't think I want to give up.
    Thanks!

    Try this:
    Rename setComp() and resizeComp() in content1 to setComp1() and resizeComp1()
    Rename setComp() and resizeComp() in content2 to setComp2() and resizeComp2()
    Now try resizing and you'll see the error being thrown with the new function names.
    I think your problem deals with unloading your content. You should maybe try to properly unload content1 before loading content2 and vs. versa and see if that fixes your problem. I suspect that the resizeComp2 is still trying to resize an object that doesn't exist on the stage anymore, but the function is still loaded into memory and running. Unloading your swfs might clear this up.

  • Multitouch with movieclip on stage

    Hello:
    Is possible to rotate, zoom,etc with multitouch class using a movieclip on stage?
    I have put this code, but not response at all, can you tell me what I do wrong? thank you:
    import flash.display.StageDisplayState;
    import flash.display.StageScaleMode;
    import flash.display.StageAlign;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import flash.display.Sprite;
    import flash.events.TransformGestureEvent;
    import flash.ui.Multitouch;
    import flash.ui.MultitouchInputMode;
    Multitouch.inputMode = MultitouchInputMode.GESTURE;
    afoto.addEventListener(TransformGestureEvent.GESTURE_ROTATE , onRotate);
    function onRotate (e:TransformGestureEvent):void{
                  myImage_mc.rotation += e.rotation;
    My movieclip  myImage_mc is on the stage.

    Excuse me I made a mistake, this is the code:
    import flash.display.StageDisplayState;
    import flash.display.StageScaleMode;
    import flash.display.StageAlign;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import flash.display.Sprite;
    import flash.events.TransformGestureEvent;
    import flash.ui.Multitouch;
    import flash.ui.MultitouchInputMode;
    Multitouch.inputMode = MultitouchInputMode.GESTURE;
    myImage_mc.addEventListener(TransformGestureEvent.GESTURE_ROTATE , onRotate); 
    function onRotate (e:TransformGestureEvent):void{
                  myImage_mc.rotation += e.rotation;

  • FLVPlayback skin position on stage resize

    Hi, Got weird problem. on stage resize the skin's hit area of
    FLVPlayback instance floats away from the supposed position. When
    setting 100% scale to the FLVPlayback instance, it works correctly.
    This happens with skinAutoHide = true.

    Read this artical, it helped me with the same problem. Put
    the skin in the same directory as the webpage file that calls your
    main movie.
    http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=608abffd

  • Mouse clicks blocked improperly when stage resizes

    Hi everyone,
    Been working on this for a while with no success. would really appreciate your help.
    We have the following issue: 1 main flex application is loading another flex application swf using a swfloader placing the child app in the same security domain, but in separate application domains from the parent. There is an '...allowDomain(*)' between the apps and the stage scaling is set to no scaling.
    The problem is that when the stage is resized (window size increases or it goes to fullscreen) the child app 'grows' a large invisible area that blocks mouse clicks from reaching the parent app. This area far exceeds the child app's width & height and can be seen only when doing 'right-click' --> 'show redraw regions'. When scaling the window slowly back to the original stage size that the flash player started out with, those areas grow smaller and eventually disappear. If i load the child app when the main app stage size (window size) is already very big (or in fullscreen), this issue does NOT appear.
    Thanks in advance,
    Uri

    Sounds like a bug.  If you have a simple test case, please file a bug.
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • How do I attach a class to a movieclip on stage?

    Hi all,
    I have a Flash movie that is to be the navigation for a web
    site, and am using Flash CS3. I have exported it from Photoshop and
    have turned the buttons into movieclips on the import. Upon import,
    I have several named movieclips on the stage. I want to be able to
    attach custom classes to these movieclips so that they have
    functionality but haven't figured out how to do this.
    My Flash file has a root document class called 'Nav'. I have
    a file named 'nav.as' in the same directory as my FLA file. I have
    a button onstage named apples_logo, which is an instance of the
    library item named ApplesLogo, which is set up for linkage with a
    Class Name of ApplesLogo and a base class of
    flash.display.MovieClip. Clicking on the "validate class
    definition" button in the linkage window indicates that Flash is
    finding the actionscript file for this class fine (which is named
    'ApplesLogo.as').
    When I execute the Flash file, though, I get the error: 1046:
    type was not found or was not a compile-time constant: ApplesLogo.
    What is going on? I'm expecting the ApplesLogo contstructor method
    to be called from my ApplesLogo class. My Nav class is in an
    unnamed package and if I create a folder named 'nav' and put my
    ApplesLogo.as file into that folder (to try to build my package
    structure), I get a message from the class definition validator
    button in the Linkage window that says it no longer finds the
    ApplesLogo class and will create an empty one for me. I figure one
    way or the other this should work, but neither is. What am I
    missing?
    Thanks for any help you can provide. My very simple source
    code is below.

    Hello there,
    I tried playing around with your code on my machine and like
    you I came across the same error you mention above. After some
    experimenting I found that if you add the package definition to
    your ApplesLogo.as file it works (well, for me it did). Both trace
    statements come thru.
    Both actionscript classes were in the same folder as the FLA
    See if this helps!

  • Stage resizing

    Hi everyone. I'm trying to create a photo gallery where an
    image gets loaded from an xml file and I want the stage to resize
    to the size of the image because the images are all going to be
    different sizes. I've looked into the Stage class, but I couldn't
    find anything that I could use to accomplish what I'm trying to do.
    The Stage.onResize function only triggers after the Stage has been
    resized. The Stage.width and Stage.height properties are read-only,
    so I can't use those to adjust the size of the Stage. Is there
    anyway to change the size of the Stage dynamically?

    Unfortunately I believe the answer is 'no'.
    (People with more info please correct me if this is wrong).
    Since flash is embedded in an html page with a fixed width
    and height, it's not possible to modify those parameters at
    runtime.

  • Air 3.0 distorts movieclip on stage

    Since switching to AIR 3.0, has anyone noticed differences in the way their mobile app looks when run in the FB4.5 environment compared to a mobile device like an iPhone 4?
    I have a simple AS3 Mobile project built in Air 2.7 which was working fine.
    I tried to compile using Air 3.0 and now a movieClip on the stage is  distorting. Hard to describe what it's doing. Essentially the y position is about 220 pixels off of the screen, and the bottom is distorted/stretched.
    The weird thing is that it only does it in the Flash Builder environment, it looks fine when the ipa is run on an iphone 4.
    Some background:
    <aspectRatio>portrait</aspectRatio>
    <autoOrients>true</autoOrients>
    <fullScreen>true</fullScreen>
    <renderMode>gpu</renderMode>

    I'm having the same result when running the AIR debug launcher (ADL) from withing Flash CS 5.5.  I downloaded and overlaid AIR 3.0 SDK per the instructions (http://kb2.adobe.com/cps/908/cpsid_90810.html).  I have a graphics-heavy FLA with the following settings:
    Publish Settings
    Player: AIR for iOS
    Script: ActionScript 3.0
    Hardware acceleration: Level 2 - GPU
    AIR for iOS Settings
    Aspect ratio: Landscape
    Full screen
    Auto orientation
    Rendering: GPU
    Device: iPhone and iPad
    Resolution: High
    Things were fine with AIR 2.7 overlaid, but since switching to 3.0 whenever I click Control > Test Movie > In AIR Debug Launcher (Mobile) I get the same display issue as noted above - the display objects are all pushed up so that the bottom edge is about 200 pixels from the top of the frame, with the last row of pixels stretched down to the bottom of the frame (ends up looking like vertical lines of color).  The buttons that are normally along the bottom, are now partially off frame at the top, however, the mouse clicks for them still register as if they were at the bottom where they're supposed to be.
    I cycled through all the different AIR for iOS Settings and it seems that having the Rendering set to GPU is the culprit.  Everything's fine in ADL unless it's set to GPU.
    I recall a similar problem with AIR 2.6/2.7 but it was eventually fixed though I don't think Adobe announced it as a bug fix, they just replaced the AIR SDK downloader quietly in the night.
    Argh!!!

  • Referencing a MovieClip on stage through XML

    Hello.
    I have a swf with several MovieClip instances on the stage at
    authoring time. For example, say I have mBuilding that contains
    mFloor, that in turn contains mAppartment.
    I have an xml file that contains data so the swf knows what
    to do with the MovieClips.
    I've been trying different things, but I'm still stumped. Can
    anyone give me some advice?
    Thanks in advance.

    still no prevail, this is now what i got so far
    AS3
    var my_x:Number;
    var my_y:Number;
    var myCoord:XML;
    var myXMLLoader:URLLoader = new URLLoader();
    myXMLLoader.load(new URLRequest("coords.xml"));
    myXMLLoader.addEventListener(Event.COMPLETE, processXML);
    function processXML (e:Event):void{
        var myXML:XML = new XML(e.target.data);
        myCoord = myXML.pos1;
        sample_mc.x = my_x = Number(myCoord.@XPOSITION);
        sample_mc.y = my_y = Number(myCoord.@YPOSITION);
    and the XML
    < position>
    < pos1 XPOSITION="100" YPOSITION="55">< /pos1>
    < /position>
    i know i'm just a beginner with AS but i really thought this was something simple. do i have obvious errors.

  • Printing of movieclip without stage color

    Greetings all,
    I have a flash stage which is in grey color. I have a blank movieclip which is in light pink in bgcolor. Can anyone tell me why when I tried to print the movieclip, my paper background will be printed grey? Is it because of my flash stage color? How do I fix this? (my original paper is white in color)
    Thanks for your time,
    -Zainuu

    Hi kglad, I will be putting a datagrid inside the printClip movieclip
    printClip.addChild(dg);
    and I will need to print out all the data inside the datagrid, so I need those values to ensure that all data will be printed (if datagrid verticial scroll policy is TRUE)
    is there other ways? Resizing of the rectangle properly or set to print no background color?
    whole script:
    for (var i = 0; i < 30; i ++)
        dp.addItem({no:i+1, Winner_Name:"Name_Name_Name_Name_Name_Name_"+(i+1), Prize_Title:"Title_Title_Title_Title_Title_Title_Title_"+(i+1),      Prize_Name:"PrizeName_PrizeName_PrizeName_PrizeName_PrizeName_"+(i+1)});
                SampleData.push(dp);
    myDataGrid.columns= ["no","Winner_Name","Prize_Title","Prize_Name"];
    myDataGrid.getColumnAt(0).width = 50;
    myDataGrid.getColumnAt(1).width = 160;
    myDataGrid.getColumnAt(2).width = 170;
    myDataGrid.getColumnAt(3).width = 170;
    myDataGrid.dataProvider = dp;
    myDataGrid.setSize(463, 178);
    myDataGrid.horizontalScrollPolicy = ScrollPolicy.ON;
    clickme.addEventListener(MouseEvent.CLICK, clickmeFn)
    var printClip:MovieClip = new MovieClip();
    clickme2.visible = false;
    clickme2.enabled = false;
    function clickmeFn(e:MouseEvent){
              //creates a moveclip and a datagrid to print
              var dg:DataGrid;
              printClip.graphics.beginFill(0xFFFF2FF);
              printClip.graphics.drawRect(0, 0, 100, 100);
              printClip.graphics.endFill();
              printClip.x = 0;
              printClip.y = 0;
              addChild(printClip);
              this.setChildIndex ( printClip , this.numChildren - 1 );
              printClip.visible = true;
              dg = new DataGrid();
              dg.move(0, 0);
              dg.setSize(570, 178);
              dg.rowHeight = 40
              dg.rowCount = myDataGrid.length ;
              dg.columns = ["no","Winner_Name","Prize_Title","Prize_Name"];
              dg.getColumnAt(0).width = 50;
              dg.getColumnAt(1).width = 160;
              dg.getColumnAt(2).width = 170;
              dg.horizontalScrollPolicy = ScrollPolicy.OFF;
              dg.verticalScrollPolicy = ScrollPolicy.OFF;
              dg.dataProvider = dp;
              printClip.addChild(dg);
              // Assign cellRenderers.
              var col1:DataGridColumn = new DataGridColumn();
              col1 = dg.getColumnAt(1);
              col1.cellRenderer = MultiLineCell;
              // Assign cellRenderers.
              var col2:DataGridColumn = new DataGridColumn();
              col2 = dg.getColumnAt(2);
              col2.cellRenderer = MultiLineCell;
              // Assign cellRenderers.
              var col3:DataGridColumn = new DataGridColumn();
              col3 = dg.getColumnAt(3);
              col3.cellRenderer = MultiLineCell;
              //print button activated
              clickme2.visible = true;
              clickme2.enabled = true;
              this.setChildIndex ( clickme2 , this.numChildren - 1 );
              clickme2.addEventListener(MouseEvent.CLICK, clickmeFn2)
    function clickmeFn2(e:MouseEvent){
              printDG();
    function printDG(){
        var my_pj = new PrintJob();
        var myResult = my_pj.start();
        if (myResult) {
            var clipHeight = printClip.height;
            var _pageHeight = my_pj.pageHeight;
            var numPages = Math.ceil(clipHeight/_pageHeight);
                        var xMargin = -20;
            var _yMin = 0;
                        var _yMax = 0;
            for(var i:int=0;i<numPages ;i++){
               _yMax = _yMin + _pageHeight;
                           my_pj.addPage(printClip,new Rectangle(xMargin,_yMin, my_pj.pageWidth, _pageHeight));
                           _yMin = _yMax;
            my_pj.send();
            my_pj=null;
    The reason I got clickmeFn2 is because if I call printDG(); at the end of clickmeFn, it prints nothing. I have no idea why is that so...
    Thanks,
    -Zainuu

  • Access movieclip on stage from class?

    Hi all,
    Is it possible to access a movieclip which has been dragged onto the main stage in my FLA from an external class that i've written? Can i create a variable that refers to the object on the stage? Or does it have to be added dynamically to be accessible?
    Many Thanks
    Matt

    Hi Ned, i'm not instantiating it as such i'm just using it to store quite a large method which is being called from the document class.
    I'm trying to break all my code down into chuncks stored in .as files so that i dont have 2,000 lines of code all in frame one of the main timeline : S
    So this is my document class:
    package  {
              import flash.display.MovieClip;
              import loadXML;
              public class mainClass extends MovieClip {
                        public function mainClass () {
                              loadXML.importXML();
    then this is the class being called from the mainClass:
    package  {
              import flash.display.Stage;
              import flash.net.*;
              import flash.events.ProgressEvent
              import flash.events.Event;
              import flash.text.*;
              public class loadXML {
                        private static var myXML:XML;
                        private static var myLoader:URLLoader = new URLLoader();
                        public function loadXML() {
                        public static function importXML():void{
                                       myLoader.load(new URLRequest("pipeLineData.xml"));
                                       myLoader.addEventListener(Event.COMPLETE, processXML);
                        private static function processXML(e:Event):void {
                                       myXML = new XML(e.target.data);
                                       objectOnStage.text = myXML.TEXT[0];
                                       //etc...
                                       //etc...
    Many thanks
    Matt

  • Stop all movieclips on stage and it's nested movieclips

    Looking for a way to stop all movieclips both are the stage and that are children of the ones on the stage.
    I toyed with looping thru stage's children so I can first target clips on the stage. But I am getting error. Any help?
    for (var i:int = 0; i < this.numChildren; i++)
         if (this.getChildAt(i) is MovieClip)
                        this.getChildAt(i).stop

    You will get a different error if that was just a typo... a 1119 is a property error, a 1061 is a method error, which is what you should have been getting if you just had a typo in your posting and not in your code.    In any case, try casting the object to be a MovieClip and that should solve the probem...
    if (this.getChildAt(i) is MovieClip){
         MovieClip(this.getChildAt(i)).stop();

  • Reposition a movieclip on stage with coordinates from an xml

    Hello i am new to this forum, and kinda a beginner with actionscript. what i'm trying to do is reposition a movieclip already with the coordinates that will be in an XML file on my server. But so far no luck.
    This is what i have for AS3
    var my_x:Number;
    var my_y:Number;
    var myCoord:XML;
    sample_mc.x = my_x;
    sample_mc.y = my_y;
    var myXMLLoader:URLLoader = new URLLoader();
    myXMLLoader.load(new URLRequest("coords.xml"));
    myXMLLoader.addEventListener(Event.COMPLETE, processXML);
    function processXML (e:Event):void{
    var myXML:XML = new XML(e.target.data);
    myCoord = myXML.position.pos1;
    my_x = myCoord.@XPOSITION;
    my_y = myCoord.@YPOSITION;
    And the XML file
    < position>
    < pos1 XPOSITION="100" YPOSITION="55">
    < /pos1>
    < /position>
    let me know if anyone can correct what i'm doing wrong, please.

    still no prevail, this is now what i got so far
    AS3
    var my_x:Number;
    var my_y:Number;
    var myCoord:XML;
    var myXMLLoader:URLLoader = new URLLoader();
    myXMLLoader.load(new URLRequest("coords.xml"));
    myXMLLoader.addEventListener(Event.COMPLETE, processXML);
    function processXML (e:Event):void{
        var myXML:XML = new XML(e.target.data);
        myCoord = myXML.pos1;
        sample_mc.x = my_x = Number(myCoord.@XPOSITION);
        sample_mc.y = my_y = Number(myCoord.@YPOSITION);
    and the XML
    < position>
    < pos1 XPOSITION="100" YPOSITION="55">< /pos1>
    < /position>
    i know i'm just a beginner with AS but i really thought this was something simple. do i have obvious errors.

  • How to control stage resizing

    My main file displays a large number of dynamically generated graphics. I have a listener to remove and then re-position the graphics if the browser is re-sized:
    stage.addEventListener(Event.RESIZE, stageResized)
    //When stage is resized, remove all children from the main component.
    //When empty, refresh the stage content
    public function stageResized(e:Event):void{
       while(mainUIComponent.numChildren>0){
            mainUIComponent.removeChildAt(0)
            addContentToStage()
    My problem is that the function works perfectly if I use the Browser Maximize/ Minimize buttons, but not if the window is re-sized manually by dragging the browser window at the bottom-right side. If I drag the window to resize, many graphics are left unerased on the stage, but all the new graphics are drawn leaving a terrible mess. If I go back to select the Maximize/ Minimize again, the screen is cleaned properly once more.
    Can anyone recommend an approach to clear out all the old graphics on a manual drag?

    Maybe add your event listeners to the Application object, and ensure width and height are 100%?
    If this post answers your question or helps, please mark it as such.

Maybe you are looking for

  • My computer crashed-how do I reset my iTunes?

    My computer crashed/froze/died. We reformatted, and I want to reset my library again. I reinstalled iTunes, but everything I read says that I cannot transfer the songs from my mini into a new library. I have to have it saved into a folder on my mini,

  • IDOC Package

    Hi Guys, I have the following scenario WS->XI->IDOC but in this scenario there will be several calls from WS and we want to send an IDOC Package. I have seen some blogs regarding the collector pattern on BPM but in some of them I have seen that there

  • Spry horizontal drop down goofup

    In an attempt to shrink my button bar, the drop down is now acting crazy in iexplorer.  When you hover over the drop down arrow, the drop down menu pops up in the upper left corner of the screen.  What have I done?  I even tried deleting then rebuild

  • Why our online software on java/oracle crashes on latest firefox 3.6.12 but worked on 3.0.9

    our online software on java crashes on latest firefox 3.6.12 but worked on 3.0.9

  • Photoshop CS3 doesnt open more than one photo

    I have win XP + Adobe CS 3 Standard installed on my pc: when i open more than one photo at the same time with Photoshop CS3, the application immediately close. I have two pc with the same configuration and i have the same problem. Note that i have Ad