Nested MC's position regarding stage

Arrgh! Here it is.
I have a master MC that's added to the stage via
addChild(p2_mc).
Inside that p2_mc, i have others MC'S (added to the stage
manually, not via addChild).
One of them is instanced fond_mc
I want to position that fond_mc in the middle of the stage
using that line of code WHEN the stage is resized. Obviously, the
following line is into the resize function:
fond_mc.x = stage.stageWidth/2;
I works but returning faulty results because it uses left
corner of the mc instead of registration point, which is top and
center.
I tried all math formula i could think of to no results.
Keeps positionning the fond_mc wrongly.
I know this is related to registration OR stage measurement.
Is there a way to reset stage.stageWidth values INSIDE the
resize function?
Thanks!

ahhh. so then when the container is brought to the stage it
*is* being aligned at 0, 0 correct?
...> nope, it is aligned when created with this
var p2_mc:MovieClip = new P2;
MovieClip(root).addChild(p2_mc);
p2_mc.x = stage.stageWidth/2;
p2_mc.y = 0;
The problem is WHEN i resizes, the children clips INSIDE the
container has no references that i can understands.
As i said, when i add this inside the resize function at root
level, it works:
p2_mc.x = stage.stageWidth/2;
because in my test files, p2_mc is added BEFORE the resize
function kicks off. And the childs move accordingly around the
stage.
But in my project file, p2_mc is dynamically created only
when the user press a button. Therefore, the resize function isnt
seeing p2_mc first hands and gives me error.
I want to avoid adding ALL of my navigation clips to the
stage on frame 2 (after the preloader) and BEFORE resize function
is run. That would work i guess, but ill have to manually rendering
them visible or not.

Similar Messages

  • Center Next Nested Movieclip to Center of Stage

    I have 4 image movieclips nested inside of a "strip" movieclip and want to move horizontally to the next image using a mouse event. It is not centering and I don't understand why the if statements aren't working.
    import fl.transitions.Tween;
    import fl.transitions.easing.*;
    var targetX:Number = (stage.stageWidth / 2 - strip.img02.x - strip.img02.width) / 2;
    var myTween:Tween = new Tween(strip, "x", Elastic.easeOut, strip.x, targetX, 3, true);
    rightbtn.addEventListener(MouseEvent.CLICK, right);
    function right(e:MouseEvent):void{
        if (var targetX:Number = (stage.stageWidth / 2 - strip.img01.x - strip.img01.width) / 2;)
            var targetX:Number = (stage.stageWidth / 2 - strip.img02.x - strip.img02.width) / 2;
            var myTween:Tween = new Tween(strip, "x", Elastic.easeOut, strip.x, targetX, 3, true);
        else if (var targetX:Number = (stage.stageWidth / 2 - strip.img02.x - strip.img02.width) / 2;)
            var targetX:Number = (stage.stageWidth / 2 - strip.img03.x - strip.img03.width) / 2;
            var myTween:Tween = new Tween(strip, "x", Elastic.easeOut, strip.x, targetX, 3, true);

    please don't open duplicate threads.

  • Loading JPEGs into set position on stage

    Hi All,
    I have made a flash movie as seen at
    http://www.coffeemamma.com.au
    and would
    like to change the following:
    I'd like to generate three random numbers from 1 to 5
    inclusive but I want
    to ensure that each number is different - e.g. 2, 4, 1 (not
    2, 4, 2). I know
    how to generate ONE random number, but I'm stuck on comparing
    them to see
    whether they are the same (and if they are, then generate new
    numbers until
    they are unique).
    With the three numbers I would like to load images based on
    those numbers -
    e.g. '_image_2.jpg' then '_image_4.jpg' then '_image_1.jpg'.
    This part is
    fine IF I can generate the numbers.
    I'd also like to have the images come to the front when they
    are hovered
    over with the mouse and then to go 'back' to their original
    position when
    the mouse moves away. This I'm completely stuck on.
    I'd also like to be able to put the newly loaded images into
    certain
    positions (as per the example) rather than only loaded to
    (0,0) coordinates.
    I also want to be able to have the images masked as they come
    in (as per the
    example) in order to avoid white corners on the top images.
    I also have a page as per
    http://www.wasabi.org.au/wodonga.shtml
    which has
    some of the functions I want to use, but I can't seem to get
    some of the
    functions working in my new movie...
    Many thanks,
    Bruce

    var arr:Array = new Array();
    var nextX:Number=whatever;  // assign these 4 numbers
    var nextY:Number =whateverelse;
    var gapX:uint = xx;
    var gapY:uint =yy;
    for(var i:int = 0; i<4; i++){
        var life_mc:Life = new Life();
        arr.push(life_mc);
        stage.addChild(life_mc);
       life_mc.x = nextX;
      life_mc.y=nextY;
    nextX += gapX*(i%2);
    nextY += gapY*Math.floor(i/2);

  • 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

  • Positions on stage become changed when the file opens

    I'm making a Flash animation in Flash CS4, using motion tweens to change positions and sizes of objects on stage. I frequently open the animation file and find a motion-tweened object has been moved to a new position from the one it was in when I last saved the file. All the frames in the tween seem to be affected. If I open the file again without saving, the object is still in the wrong position. I have had to redo or substantially correct a big tween several times. It's wasting time, and I can't rely on my work being in the state that I saved it last. I think the problem happens to the files when I open them after starting up Flash.
    Does anybody have any idea what could be happening, and how to stop it?

    Sorry, forgot details: I'm using Flash on Window XP Home ed. My version is Flash CS4 version 10.0.2.

  • Writing position of stage to file as it moves along with relative time.

    I'm wondering how to get the position of a stage I am controlling through labview to continuously write its position.  I have an indicator set up with its position and the indicator shows the values as it moves along its axis, however when I try to save these values, only the initial value when I start the motion of the stage is displayed.

    It would help if you posted your VI so we can see what you tried.
    Most likely you need to create an array of the values and then write the array to the file.
    Lynn

  • How to position the Stage at the first available place on the screen

    Im creating a Stage,
    but for any reason when I dont define x,y it shows in different places on the screen, and sometimes outside of the screen
    if I set x=0 and y=0 I have problems, because some user, like me, use the taskbar on the top of the screen,
    anybody knows how do workaround this ?
    this is the code of my Stage
    public class Game extends Stage {
        public var tick: Timeline = Timeline {
            repeatCount: Timeline.INDEFINITE
            keyFrames: [
                KeyFrame {
                    time: 0.01s
                    action: function() {
                        mainLoop();
        // main game loop
        public function mainLoop(){
            for (node in scene.content) {
                if( node instanceof Updatable){
                    (node as Updatable).update();
        public function play(){
            tick.play();
    }and this is how I'm using it
    var game: Game = Game {
        title: "Cabecudinhos, episódio 1 o ataque dos mosquitos"
        x: 0
        y: 0
        width: 800
        height: 600
        scene: Scene {
            content: [
                background
                littleBox
    function run(__ARGS__ : String[]) {
        game.play();
        soundtrack.play();
    }

    You can ask Java for that.
    You can just center the stage on screen, that's quite easy given the screen dimensions:
    import java.awt.*;
    var dim: Dimension = Toolkit.getDefaultToolkit().getScreenSize();
    println("Screen is {dim.getWidth()}x{dim.getHeight()}");I suppose it works for main screen, there is code to get the info for all screens (if several are connected).
    If you need to know the placements of the taskbar and other bars, you need to get the insets, which is a bit more convoluted.
    var ge: GraphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
    var gsl: GraphicsDevice[] = ge.getScreenDevices();
    var gcl: GraphicsConfiguration[] = gsl[0].getConfigurations();
    var ins: Insets = Toolkit.getDefaultToolkit().getScreenInsets(gcl[0]);
    println("Insets are T {ins.top}, L {ins.left}, B {ins.bottom}, R {ins.right}");It shows B 34 for my setting and T 34 if Windows' taskbar is on top, etc.

  • Resizing and positioning a stage with a background image

    Hey guys,
    I'm trying to get some specific behaviour on a stage as I think it'll work out best for the application I am doing. The module I am working on right now consists of a stage with an imageview bound to the width and height and an image inside. I'm eventually looking to setup some animations and such which will overlay on the image but I want the window to be resizable in various ways.
    Right now, when the stage is created I manually set the width and height so the image fits perfectly in the stage. For resizing, I want the user to be able to drag either the height or width or diagonal sliders but have the original aspect ratio of the stage retained. I have the preserveRatio variable set to true in the ImageView which makes the image not become distorted, but the stage can be extended horizontally/vertically/diagonally to any ratio which I'd rather not have. In terms of fullscreening, I'd like to allow it and have the image centred.
    I've tried to see if the LayoutInfo class can help me out, but it doesn't seem to have any implementations which are too useful for what I am trying to do. So does anyone know how I can accomplish the above? I'm very new to JavaFX so if anyone can make any other suggestions in terms of the objects I am using and what's best practices for what I am trying to do, it would be much appreciated. I've looked into using PathAnimation and PathTransition for the animations I am using and while they'd do most of the job well, I need to be able to place objects, modify speeds, locations etc. so I'll probably just end up making some custom drawing methods.
    Thanks in advance,

    Similar request in [JavaFX rezising-scaling scene & elements|http://forums.sun.com/thread.jspa?threadID=5437642]...
    Mmm, I made various experiments. The difficulty is to watch both dimensions, because when one change, the other must be changed as well, but the watch is then triggered, making a cascade of changes... I solved it (partly) with a boolean disabling the secondary change.
    def image = Image
        url: "file:///D:/images/forest_0003_1024.jpg";
        preserveRatio: true
    def startSize = image.width / 3;
    var bResizingWidth: Boolean;
    var bResizingHeight: Boolean;
    var stw = bind scene.width on replace
    println("Width -> {stw}");
        ResizeStage(true);
    var sth = bind scene.height on replace
    println("Height -> {sth}");
        ResizeStage(false);
    var scene: Scene;
    var iv: ImageView;
    def stage = Stage
        title: "Proportional Stage"
        scene: scene = Scene
            content: iv = ImageView
                image: image
                preserveRatio: true
                fitWidth: startSize
    def frames: java.awt.Frame[] = java.awt.Frame.getFrames();
    //~ println(frames[0]);
    def insets = frames[0].getInsets();
    //~ println("T={insets.top} L={insets.left} B={insets.bottom} R={insets.right} ");
    def insetX = insets.left + insets.right;
    def insetY = insets.top + insets.bottom;
    function ResizeStage(bIsWidth: Boolean): Void
        if (stage.width == 0) return; // Init, nothing to do
        if (bResizingHeight and bIsWidth) // One dim is changed, don't react on setting of other dim
            bResizingHeight = false;
            return; // Just ignore secondary change
        if (bResizingWidth and not bIsWidth) // Idem
            bResizingWidth = false;
            return; // Just ignore secondary change
        if (bIsWidth)
            bResizingWidth = true;
        else
            bResizingHeight = true;
        println("Stage: {stage.width} x {stage.height}");
        def ratio = image.width / image.height;
        if (bIsWidth)
            stage.height = scene.width / ratio + insetY;
            println("H {scene.width} -> {stage.height}");
        else
            stage.width = scene.height * ratio + insetX;
            println("W {scene.height} -> {stage.width}");
        iv.fitWidth = scene.width;
    }There are still some glitches, but it roughly works...
    [EDIT] Changed to avoid resizing the dimension that the user is changing. Result is more logical but slightly worse... (?)
    Edited by: PhiLho on 29 mai 2010 13:24

  • Movieclip registration point defaulting to top left of nested movieclip when placed on stage

    basicaly there is a movieclip holding multiple movieclips with animations that pass from right to left making the overall registration point of the parent MC to somewhere right of the stage
    in the parent movieclip there is a background that is the exact size and placement of the stage and the top left of that background is where the parents registration point is being loaded at..I
    I'm not sure if this has any relivance but i defined the movieclip as a variable and placed that variable at the specified coords..
    addChild(PLevel);
        PLevel.x = w/2;
        PLevel.y = h;
    where w is the max width of screen  and h is the min height
    my registration for that moveclip would be the bottom of the movieclip centered on the stage background

    I can't find anything of a question or problem in your posting.  You mention three different locations for registration points, but I am unable to determine anything from your doing so.

  • Nested regions best practice regarding inheritance of editable regions.

    Have a template page, http://www.satgraphics.com/templates/main_01.dwt in which I have an area labeled  "div#main_wrapper".
    When attempting to  make it an "editable" region, I received the following comment: "The selection already contains or overlaps with an editable, repeating, or optional region".
    I had already made the "header" and "column_left" regions editable, but as the "column_left" is nested within the wrapper, my question would be; Would the correct process be to un-do the "column_left" editable region, make the "div#main_wrapper" editable, and be able to edit the "column_left" area as an inherited editable area?
    When I did try to do so to the "main_wrapper" div, I did not get the identifier label (blue text block at top left of each area) and received the warning as mentioned previously.
    Thank You...

    I did attempt to specify the "main_wrapper" div, but did so after already creating the "column_left" div region as editable, (nested in the "wrapper") and that is when I received the error message.
    As an aside, the site is fairly simple, so I am using a single template in which I do make content changes to header, column_left, and hopefully within the wrapper itself) for each new page, thus intentionally wanting editable region in content of "wrapper".
    The "footer" and "menu" are the two areas in which I did not open up for change; the "menu" is a library item, so any changes are made from there.
    So, question now becomes that of getting the "main_wrapper" div editable and how can that be done without the aforementioned message?
    http://www.satgraphics.com/templates/main_01.dwt
    Thank You for your help.

  • Access a nested symbol timeline from the main stage

    Hi all,
    Would love some help on accessing a nested symbol from the main stage please.
    To set the scene.....
    "Its an autumn day..
    no sorry...just joking...
    So i have a symbol called "NormalAnatomy" - its not on the main stage, but when a button is clicked it appears in the 'content' box which is just a rectangle on the main stage.
    Inside "NormalAnatomy" symbol is another symbol called "Scrub_all" which is an animation
    For users to view the animation they use a scrub bar like this lovely lady has invented:
    Create Click and Touch Draggable Scrubbers with Edge Animate CC | sarahjustine.com
    So for Sarah Justines scrubber to work - the main stage has a lot of actions added to it. Also the "timelinePlay" symbol is on the main stage
    Its starts:
    var symDur = sym.getSymbol("timelinePlay").getDuration();
    var mySymbol = sym.getSymbol("timelinePlay");
    var scrubber = sym.$("scrubber");
    var bar = sym.$("bar");
    sym.$("mobileHit").hide();
    var dragme = false;
    So I put my "NormalAnatomy" symbol on my main stage to see if the code would work and changed all the relevant details.. and indeed it worked!
    var symDur = sym.getSymbol("NormalAnatomy").getSymbol("Scrub_all").getDuration();
    var mySymbol = sym.getSymbol("NormalAnatomy").getSymbol("Scrub_all");
    var scrubber = sym.getSymbol("NormalAnatomy").$("scrubber");
    var bar = sym.getSymbol("NormalAnatomy").$("bar");
    sym.getSymbol("NormalAnatomy").$("mobileHit").hide();
    var dragme = false;
    But i don't want the "NormalAnatomy" symbol to be on the main stage as I want it to appear in the 'content' box only when i hit a btn
    So as soon as I took this symbol off the main stage, the scrubber doesn't work. So I click a btn, and the symbol appears in the content box but the scrubber doesn't work.
    so I tried in front of the "NormalAnatomy"
    getStage().
    getStage("content").
    getComposition().getStage().
    getSymbol("content").
    but nothing works
    The main problem must be the fact that the NormalAnatomy symbol appears inside a content box so the MainStage actions doesn't know how to find it??
    So my question is... what should I put in the main stage actions to make it access the "NormalAnatomy" symbol?
    Thanks for your help in advance!

    On click handler for the symbol use
    sym.getComposition().getStage().getSymbol("nameofsymbol").play();
    or
    sym.getSymbol("nameofsymbol").play();
    replace the italics with the literal name of the symbol as it appears in the Elements panel.
    Some API details found here (http://www.adobe.com/devnet-docs/edgeanimate/api/current/index.html) in the Work With Symbols section.
    Darrell

  • Can macros be nested???

    Hi,
    In my HR Report,I have to get the active employee details of an Org Unit and in selection i have OU field
    I have used the macros to solve this
    GET PERNR.
    RP-PROVIDE-FROM-LAST P0000 SPACE PN-BEGDA PN-ENDDA
    IF PNP-SW-FOUND EQ 1.
       IF P0000-STAT2 = '3'. -
    >here i m checkin whether the employee is active
       ELSE.
           EXIT.
       ENDIF.
    ENDIF.
    RP-PROVIDE-FROM-LAST P0001 SPACE PN-BEGDA PN-ENDDA. -->using this macro i m gettin      
    IF PNP-SW-FOUND EQ 1.                                                         employee position nd other field value
    ENDIF
    Instead of using like mentioned above, shall i nest the macros as shown below :
    GET PERNR.
    RP-PROVIDE-FROM-LAST P0000 SPACE PN-BEGDA PN-ENDDA
    IF PNP-SW-FOUND EQ 1.
       IF P0000-STAT2 = '3'. -
    >check employee is active and if so get the p0001 value..
            RP-PROVIDE-FROM-LAST P0001 SPACE PN-BEGDA PN-ENDDA
            IF PNP-SW-FOUND EQ 1.
            ENDIF
        ELSE.
           EXIT.
       ENDIF.
    ENDIF
    nd I like to know there s any performance factor associated with this nested macros??
    Regards,
    Kiruthi

    >
    kiruthiga balusamy wrote:
    > Hi,
    >
    > In my HR Report,I have to get the active employee details of an Org Unit and in selection i have OU field
    > I have used the macros to solve this
    >
    > GET PERNR.
    > RP-PROVIDE-FROM-LAST P0000 SPACE PN-BEGDA PN-ENDDA
    > IF PNP-SW-FOUND EQ 1.
    >    IF P0000-STAT2 = '3'. -
    >here i m checkin whether the employee is active
    >    ELSE.
    >        EXIT.
    >    ENDIF.
    > ENDIF.
    >
    > RP-PROVIDE-FROM-LAST P0001 SPACE PN-BEGDA PN-ENDDA. -->using this macro i m gettin      
    > IF PNP-SW-FOUND EQ 1.                                                         employee position nd other field value
    > ENDIF
    >
    > Instead of using like mentioned above, shall i nest the macros as shown below :
    >
    > GET PERNR.
    >
    > RP-PROVIDE-FROM-LAST P0000 SPACE PN-BEGDA PN-ENDDA
    > IF PNP-SW-FOUND EQ 1.
    >    IF P0000-STAT2 = '3'. -
    >check employee is active and if so get the p0001 value..
    >         RP-PROVIDE-FROM-LAST P0001 SPACE PN-BEGDA PN-ENDDA
    >         IF PNP-SW-FOUND EQ 1.
    >         ENDIF
    >     ELSE.
    >        EXIT.
    >    ENDIF.
    > ENDIF
    >
    > nd I like to know there s any performance factor associated with this nested macros??
    >
    > Regards,
    >
    > Kiruthi
    hi kiruthiga balusamy
        Yes u can write the program as u have written and there won't be any performance issue. Hey Krithiga r u from KV No.1 Uppal. If so I am Srinivas from 12 C
    Regards,
    Srinivas
    09836093634

  • To Absolute postion or not to Absolution position

    I have heard in docs and out on internet blogs talking about
    performance hit that flex gets when there are too many nested
    containers, and suggestions to use alternative /css solutions,
    possibly absolute possitioning to improve performance, on other
    hand I have evangelists who are strictly against absolute
    positioning favoring (width="100%") theory, so as currently I am
    in-front of 50,000 lines of code, and many many nested components I
    would really use some advice if what is really a practical way of
    getting read of :
    <mx:Hbox>
    -<mx:VBox>
    --<mx:form>
    ---<mx:Hbox> etc ..

    I too have heard these concerns and we usually opt for a
    constraint based layout to avoid many levels of nesting. For issues
    regarding performance details you might want to try the Yahoo
    Groups flexcoders group. Many of the Flex engineers respond to
    issues and would have a more complete answer for you. Here's a link
    to the group
    Flex
    Coders.

  • How is workflow assigned to positions and particular company code / plants

    Hi Everyone,
    We have updated a system with a new company code and corresponding new plants for profit center update. Now, they want the workflow handling of INVOIC, DESADV and ORDRSP to still be maintained. There is an existing workflow for error handling on these messages for the  old company code and plants. The workflow items are sent to certain positions maintained in PPOM. Now, I am requested to create new positions that will receive the notifications for errors on incoming invoices, order responses and dispatch advices for the new company code/plants. Creating new positions and assigning agents to them is quite easy but my problem is where to specify the information about the company code and plants. For the existing positions, only the Basic data tab is maintained where only an abrreviation of the position and its definition need to be entered.
    Right now, the workflow items for the new company code and plants are directed to a position that already exists in PPOM before the project. So how can I have the workflow items be directed to a new position that I will create?
    I hope someone can provide an answer to this. Thanks!

    Hello
    Are the workflows custom or standard ones?
    You need to check the workflow definition as to how they are designed to get the Positions and then change accordingly. The email task may be assigned to positions directly, or there is some custom code or a Workflow Rule.....First get to the agent determination (by going to Workflow Definition) and then you may change the "logic" for positions.
    regards,
    Modak

  • Nested table in webdynpro java

    Hi Experts,
    I have a requirement where i need to display nested table. I am using NWDS 7.0.14.
    Is it possible to design grouped rows?
    Thanks in advance,
    Vinay

    Hi Vinay,
    It is not possible in NWDS 7.0 to create nested tables.
    Thanks & Regards,
    Bhargava.

Maybe you are looking for

  • How can I accompany my portrait with music and a dialogue balloon?

    My birthday is the middle of next month, and I'm thinking of sending my picture+a song+a dialogue balloon. Who knows, I might even add other gimmicks, but I do want to include these three things. My question is, how can I do it? I'm the opposite of a

  • Really weird ... need help!!

    Hey all ... I need your help!! I typically use Safari and Firefox for browsing on my iMac. Until this evening, I have always been able to highlight the text in the address bar and type the site I want to go to (i.e. xmradio). I have never had to type

  • File Retrival From DB...

    Hi Friends, Can any one help to how to Upload All types of file to SQL Server 2000... and Retriving Back from DB and reading it in original format. Regards, Immu.

  • 'creation date of the change document' in me23n or me22n

    hi experts,                i want a help from you to find out where ( in which ) table the  'date'  field is getting stored.if u go to me23n and give a po number and go to menu bar  environment --> header changes, then we can find 'creation date of t

  • Hardware acceleration with Flash Player 10

    I came across an article on potential hardware acceleration enhancements in Flash Player 10: http://www.adobe.com/devnet/logged_in/jchurch_flashplayer10.html But I was wondering how to take advantage of this?  Here is the snippet from the article whi