Setting width on a sprite causes things to disappear?

I'm a little confused as to what is going on when I set the
width of a sprite manually.
In the attached code, nothing shows up.
If I comment out the "width = 300" line, the circle shows up
as expected.
I'm not sure why manually setting the width of the sprite
causes its child to disappear.
Any ideas?

setting the width or height of a display object before
anything is attached to it causes the sprite to silently fail. When
you add a child to a sprite, the height and width are automatically
generated, so there really isnt much need to set height and width
before you add children. after you add the children you can set
height and width to resize the sprite as you see fit.

Similar Messages

  • It seems my "passed" events in my calendar are not on my iphone anymore...Is there a setting I have changed that caused them to disappear?  They do still appear on my Outlook calendar on my pc?  How can I get them to show up on my iphone again?

    Events that are in the past do not appear on my calnedar on my iphone.  Have I possibly changed a setting that caused them to disappear?  Can I get them back on my iphone as they do still appear on my Outlook calendar on my PC?

    Settings> Mail, Contacts, Calendars> in Calendar section change the Sync setting.

  • Building Site CSS Safari Problem, no set width?

    Strange problem in Safari, i have a image holder and a description for the image below both floating left, done as a class so you can have another one along side with a different image.
    The image holder doesn't have a set width because the image that goes into it will be varying widths.
    This for some reason does not work in Safari, see here
    Its bizarre because it works fine in IE,FF etc
    Can Safari only render using a set width? Or is there a hack around it?
    Any ideas?

    Here's the thing. I see some items which could be causing
    problems. However, we need to fix the basics before going too far
    into this or you will end up with more problems than when you
    started.
    Run your pages through the validator (
    http://validator.w3.org/ ) and
    fix those errors first. Your problems here seem to be identical on
    both pages. For instance, you have an extra head tag, you have
    <style> tags in the middle of your document (these are only
    allowed in the head), etc.
    Go through those and once you have eliminated the errors from
    the validation we can solve your problems with the
    positioning.

  • Setting width/height too early??

    I noticed if I set width and/or height before adding it to
    displayList, the displayObject simply won't show up. The following
    code is a cut&paste from livedoc (SimpleButton), except that I
    add a line of "button.width=20".
    If, however, I move the line to after addChild(), things work
    normally.
    Why?:confused: :confused: :confused:
    [CODE]
    package {
    import flash.display.*;
    import flash.events.*;
    public class SimpleButtonDemo extends Sprite {
    public function SimpleButtonDemo( ) {
    // Create a simple button and configure its location
    var button:SimpleButton = new SimpleButton( );
    button.x = 20;
    button.y = 20;
    //// ################# Added by me. Button won't show up any
    more.
    button.width = 80;
    // Create the different states of the button, using the
    // helper method to create different colors circles
    button.upState = createCircle( 0x00FF00, 15 );
    button.overState = createCircle( 0xFFFFFF, 16 );
    button.downState = createCircle( 0xCCCCCC, 15 );
    button.hitTestState = button.upState;
    // Add an event listener for the click event to be notified
    // when the user clicks the mouse on the button
    button.addEventListener( MouseEvent.CLICK, handleClick );
    // Finally, add the button to the display list
    addChild( button );
    //// ############### This works, if added here!!!!
    // button.width = 20;
    // Helper function to create a circle shape with a given
    color
    // and radius
    private function createCircle( color:uint, radius:Number
    ):Shape {
    var circle:Shape = new Shape( );
    circle.graphics.lineStyle( 1, 0x000000 );
    circle.graphics.beginFill( color );
    circle.graphics.drawCircle( 0, 0, radius );
    circle.graphics.endFill( );
    return circle;
    // Event handler invoked whenever the user presses the
    button
    private function handleClick( event:MouseEvent ):void {
    trace( "Mouse clicked on the button" );
    }[/CODE]

    You're using the simple button class. Just because you
    instantiate an object of this class doesn't mean you've added
    anything to the button.
    What I'm trying to tell you is that addChild has nothing to
    do with it. Simple Button just happens to be dependent on what is
    defined inside the button states themselves.
    For instance, comment out your hitStates leaving your width
    call after the addChild and you should notice the same behavior as
    before. By defining the button states, you are actually adding
    content to the container that will be drawn to the display when
    addChild is called.
    You can define your height and width anytime after you have
    defined the states for the button. At this point, Flash will then
    have content to manipulate. Until you have drawable content to push
    to the display list, nothing will happen when width and height are
    called.

  • Set Width for a column, Merge cells in Excel

    Hi all,
    I am using jacob.dll to open and modify an Excel file. And I am stucking in below trouble:
    Dispatch workbook = Dispatch.invoke(workbooks, "Open",
              Dispatch.Method,
              new Object[]"D:\\02042005.xls",
              new Variant(false), new Variant(false)},
              new int[1] ).toDispatch();
    Dispatch sheet = Dispatch.get(workbook,"ActiveSheet").toDispatch();
    System.out.print(sheet.get(sheet,"Name") + "\n");
    Dispatch a1 = Dispatch.invoke(sheet, "Columns",
              Dispatch.Get,new Object[] {"A:A"},
              new int[1]).toDispatch();     
    Dispatch.put(a1,"Width","8");
    Error message is that I can not set value Width for object RANGE! so strange... Is there any ways to set Width for a certain column?
    Any help is appreciated.
    Regards,
    YukiNguyen

    Hi all,
    :) At last I can work done with Jacob, so great :) take me all yesterday to find more... just hope this post can help someone like me save one day to find how :)
    //Get Range
    Dispatch orange = Dispatch.invoke(osheet,"Range",Dispatch.Get,new Object[]{"A1:I1"},new int[1]).toDispatch();
    //Get Column I & set Width
    ocolumn = Dispatch.invoke(orange,"EntireColumn",Dispatch.Get,new Object[]{"I"},new int[1]).toDispatch();
    Dispatch.put(ocolumn,"ColumnWidth","60");
    //Merge cell
    orange = Dispatch.invoke(osheet,"Range",Dispatch.Get,new Object[]{"C12:D12"},new int[1]).toDispatch();
    orange.call(orange,"Merge");
    Is it exciting, huh? :) I am trying to set HorizontalAlignment... beginner always stuck in somethings :)... but I have learnt so much
    Regards,
    YukiNguyen

  • [svn:fx-trunk] 11999: Fixed: ASC-3889 - Using setting in a for loop causes Verify error

    Revision: 11999
    Revision: 11999
    Author:   [email protected]
    Date:     2009-11-19 11:37:09 -0800 (Thu, 19 Nov 2009)
    Log Message:
    Fixed: ASC-3889 - Using setting in a for loop causes Verify error
    Notes: emit pop after callstatic to a void function to balance the stack.
    Reviewer: jodyer+
    Testing: asc,tamarin,flex checkin tests
    Ticket Links:
        http://bugs.adobe.com/jira/browse/ASC-3889
    Modified Paths:
        flex/sdk/trunk/modules/asc/src/java/macromedia/asc/semantics/CodeGenerator.java

    Blacklisting the ahci module does indeed get rid of the error. Would be nice to figure out why it was conflicting with the ahci module though.
    I have not yet tried the 173xx drivers, but the latest drivers for the Quadro FX 580 are the 256.53 drivers according to nvidia.
    Posted at the nV forums (http://www.nvnews.net/vbulletin/showthread.php?t=155282), so we'll see what they suggest.

  • How to set width of cfgid in percentage?

    I have to make the cfgrid compatible irrespective of screen size. But it is not taking width in perecntage(giving error : Attribute vallidation error, height/width can not be given in percentage.)
    I put the cfgrid inside a div and set width of the div as 100%, but it has no effect on the cfgrid.
    Can anyone please give me a solution??
    I will be thankfull towards any helpfull suggestion.

    Then you have to find a way to get the browser to send information about screen size to ColdFusion. One way to do it is by means of AJAX. Another, in my opinion much simpler way, is to get Javascript to store the screen size as a cookie, and then to get ColdFusion to read the cookie. I was thinking of something like this
    <script type="text/javascript">
    var browserWidth = screen.width;
    var browserHeight = screen.height;
    var expiryDate=new Date();
    /*set expiry date tomorrow*/
    expiryDate.setDate(expiryDate.getDate()+1);
    document.cookie= 'browserWidth='+browserWidth+',browserHeight='+
                                browserHeight+',expires='+expiryDate;
    </script>
    <cfset percentWidth = 90>
    <cfif isDefined("cookie.browserWidth")>
        <cfset browserWidth = cookie.browserWidth>
    <cfelse>
        <cfset browserWidth = 800>
    </cfif>
    <cfset gridWidth = int(percentWidth*browserWidth/100)>
    <cfform>
    <cfgrid format="html" name = "myGrid" width="#gridWidth#">
    </cfgrid> 
    </cfform>

  • How to set width for this modal dialog box?

    Hi All,
    How to set width to this modal dialog box:
    <input id="btnVote" onclick="javascript:SP.UI.ModalDialog.showModalDialog({ url: &#39;../Lists/Sports%20Activities%20Voting/NewForm.aspx&#39;, title: &#39;User Survey&#39;}); return false;" type="button" value="Vote"/>
    Thanks in advance!

    set as bellow:
    <input id="btnVote" onclick="javascript:SP.UI.ModalDialog.showModalDialog({ url: &#39;../Lists/Sports%20Activities%20Voting/NewForm.aspx&#39;, title: &#39;User Survey&#39;,width:700,height:350}); return false;" type="button" value="Vote"/>
    yaşamak bir eylemdir

  • How to set width to be same as screen size?

    Dear all
    I want to set the width of my view elements to be same as that of screen size, so that if a user with low resolution monitor runs it, or if a user with high resolution monitor runs it, both see the same.
    I tried setting the width to 100%. But it is not working.
    My root container layout is Grid layout.
    Any suggestions please?
    Thanks in adv.

    Hi,
    For ROOTUIELEMENTCONTAINER set the stretchedHorizontally,stretchedVertically to true.
    And for the UI element set width as 100%, this will make the UI elem to expand to the complete screen.
    Best regards,
    Suresh
    Message was edited by:
            Suresh Honnappanavar

  • Fixing a set width for horizontal menu bar

    I'm using the Spry horizontal menu bar at the top of my page and want to put it as a set width that doesn't zoom or shrink in size when someone uses this function on their screen.  At the moment, when zooming, the menu wraps to the next line.  How can I stop this?  Does anyone know how to do this please?
    Many thanks,

    You can set the width of the menuitems as a percentage, you can also set a minimum width for the menubar container (UL).
    Gramps

  • The default priority setting in Mail is set to "normal"  and is causing emails I send to be sent with red priority flag. How can I set default priority to low = no flag?

    The default priority setting in Mail is set to "normal"  and is causing emails I send to be sent with red priority flag.
    I have found the flags to reduce the priorty level manually to "low Priorty", but how can I set default priority to low = no flag?
    Thank you for advising,

    Try deleting the .plist.
    Quit the application.
    In Finder hold down the option/alt key while selecting the Go menu item. Select Library. Then go to Preferences/com.apple.mail.plist. Move the .plist to your desktop.
    Open the application and test. If it works okay, delete the plist from the desktop. 
    If the application is the same, return the .plist to where you got it from, overwriting the newer ones.
    If you want to make your user library permanently visible, run the below command in Applications/Terminal.
    chflags nohidden ~/Library/
    You will need to do that after any updates.

  • My iPad Air always freezes during FaceTime calls using wifi. I switch to my iPhone 5c on the same wifi, and it never freezes while I'm sitting in the same location. Is there maybe a setting I have that is causes this? I am un to date on the OS also.

    My iPad Air always freezes during FaceTime calls using wifi. I switch to my iPhone 5c on the same wifi, and it never freezes while I'm sitting in the same location. Is there maybe a setting I have that is causes this? I am up to date on the OS 7.1.1. Video and audio is froze on my end, only video freezes on the other end. It doesn't make a difference who makes the call either.

    No, there isn't any setting that you are missing. Have you tried force closing FaceTime, and resetting your iPad?
    In order to close FaceTime, you have to drag the app up from the multitasking display. Double tap the home button and you will see apps lined up going left to right across the screen. Swipe to get to the app that you want to close and then swipe "up" on the app preview thumbnail to close it.
    Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.
    If that does not make a difference, you could try resetting all settings, if you reset all settings you will have to enter all of the device preferences again in the settings app. That takes some time to accomplish, but you will not lose my data, media, apps or anything like that. Settings>General>Reset>Reset all settings.
    If that doesn't help, the next step would be to restore the iOS software. Backup your iPad first, restore the iOS, then restore the backup.
    Use iTunes to restore your iOS device to factory settings

  • How to make a scroll animation constantly fixed after scrolling? I want the animation to Start when I scroll down, but I don't want the animated thing to disappear when I scroll up again.

    How to make a scroll animation constantly fixed after scrolling? I want the animation to Start when I scroll down, but I don't want the animated thing to disappear when I scroll up again.
    I know how to start the animation by scrolling down, but I simply want it to stay there after it. Could you help me please, guys?

    Hi Tom,
    There is no native feature in Muse to achieve this.
    Regards,
    Aish

  • HT1414 hello, i updated my iphone and every thing is disappear including mphoto y and contact, so please can you help how i get my photo and contact back?

    hello, i updated my iphone and every thing is disappear including my photo and contacts? does any one can help me please!!
    how can i get my photo back and my contact?

    Restore it from the last backup you made before you attempted to update. You did back it up first, right?

  • I accidentally deleted photos from my photo stream, causing them to disappear from my camera roll aswell. I am desperate to get these photos back. Is there any way I can recover them? Thanks

    Hi, I accidentally deleted photos from my photo stream, causing them to disappear from my camera roll aswell. I am desperate to get these photos back. Is there any way I can recover them? Thanks

    Hi Am1121,
    Welcome to the Apple Support Communities!
    If you have a backup of your iPhone on either iCloud or iTunes from the time when those photos were on the Camera Roll, you can restore from that backup and recover those photos. Please use the following article for information on restoring from backups.
    iOS: Back up and restore your iOS device with iCloud or iTunes
    http://support.apple.com/kb/HT1766
    Have a great day,
    Joe

Maybe you are looking for