Noob question about adding a child

I'm exercising scripting and struggling with adding a child to a object when the creation of the child is wrapped in this function
function makeBox():void {
var box:Shape = new Shape;
box.graphics.beginFill(0x66FF00);
box.graphics.lineStyle(5, 0x6600CC);
box.graphics.drawRect(mouseX, mouseY, 50, 50);
addChild(box);
Now I want to add the above shape as a child to this object
var Clip:MovieClip = new MovieClip;
addChild(Clip);
if the first code was not a finction I have no problem to add the child by  Clip.addChild(box); but I cant figure out how to use it if it is as a function.

I'm not clear on your true goal, but the thing with having all that code in the function is that because you declare the box inside the function it only has scope within the function.  If you want something outside the function to be able to utilize it then you need to declare it outside the function...
var Clip:MovieClip = new MovieClip;
addChild(Clip);
var box:Shape;
makeBox():
Clip.addChild(box);
function makeBox():void {
     box = new Shape();
     box.graphics.beginFill(0x66FF00);
     box.graphics.lineStyle(5, 0x6600CC);
     box.graphics.drawRect(mouseX, mouseY, 50, 50);

Similar Messages

  • Question About Adding Ram from other laptop to T-series Thinkpad

    Hi,
    I have a question about adding additional RAM. Right now I have a 4gb ram stick in the t510. I have an acer laptop which I do not need and there is a 4GB ram stick onboard (maybe two 2gb ram sticks) there in that older laptop. Would it be possible to add one stick of 2gb ram (or 4gb i need to check if it is 2 or 1) from the acer to the lenovo thinkpad making the total ram in the thinkpad over 4gb????
    Thanks in advance

    Hi Richk,
    Yes, I am using a 64-bit operating system. I am running on windows 7. And as for reported incompatibilities....technically taking a RAM from another laptop and placing it in the laptop should be the same as purchasing a RAM card from ebay or something and putting into the laptop right?

  • 2 noob questions about speaker settin

    . What if I don't sync the Creative speaker settings with windows control panel speaker settings?
    2. What if I the speaker settings(both Creative and windows) don't match my speaker type?For example, I have only headphone connected to my Audigy 2 ZS but I set the speaker setting to 5. or whatever else. Will this improve my sound quality in games such as Battlefield 2? Am I?supposed to get the virtual 5. surround sound effect? Because I've heard that cmss upmixes stereo sound in?games to virtual 5. or 7. surround sound for headphones.
    Thanks.
    Message Edited by jermin on 06-24-2008 02:09 PM

    Re: 2 noob questions about speaker settings?slightlys I have a slightly different set up.
    I have 5. speakers that I use for movies and some games. For BF242 I use headphones because they give you an advantage as you can hear people creeping up behind. The virtual surround sound is really good with my XFi xtremeMusic.
    First I don't think it matters what you select under Windows Control Panel as the Creative Console Launcher updates speaker settings in Windows. Second if you want virtual 3d with CMSS on headphones just select headphones and enable CMSS3D. Then click the 'headphone' button on the CMSS3D tab and you can test the sound - a helicopter pans around in 360 degrees.
    Then in games set the software to output 5. - AFAIK. Battlefield seems to do this automatically but I can't speak for other games. I'm assuming the Audigy has the same CMSS3D tech that the XFi has.

  • Question about adding an index to a column and finding it back

    Hi, How do I see in phpMyAdmin that an index is added to a column.(I'm talking about adding an index by clicking on the lightning bolt!) I know how to add an index and see a warning that it's added (only after I add it).
    But where do I find it or a sign that it is added later on?!
    Thanks!

    You also may find better exposure for this question on the Dreamweaver Applications Development forum -
    http://forums.adobe.com/community/dreamweaver/dreamweaver_development

  • Questions about adding files in LR3

    I've been a happy LR user for years. I used the LR3 beta and liked it (especially the 2nd version) and generally I'm very happy with the release version of LR3. But I have some questions about the import process.
    In LR2 I could edit off my Compact Flash cards (I know that's not smart, but sometimes on deadline fast is better than not smart) by adding the photos my library without moving them. That option is grayed out in LR3. Is there a way to turn it on or is this is a "new feature." If it's a permanent thing, maybe for 3.1 or the next incremental upgrade Adobe could make this possible with a popup (like we get when adding captions to multiple files) warning that editing photos on a CF (or SD) card is a bad idea. But let us make the decision.
    jack

    It's a deliberate change - time to adjust the workflow!
    John

  • Noob question about launching apps

    Greetings all,
    Just made the switch to a Powerbook with OS X Tiger, and have a question about launching applications; specifically how to do so without using the mouse. On my Linux boxes (one at home, one at work), I do most of my work from the keyboard, without resorting to the mouse, even in Gnome or KDE.
    In Tiger, I can select applications on the desktop, but haven't been able to figure out how to launch them without "clicking"... I've Googled and searched these forums, but no luck so far. Under Linux, it's the Enter key. I assume in Tiger it's some key combination...
    I know there's probably a simple answer, but I've not been able to happen upon the appropriate key combo it at random, so I thought I'd ask the experts.
    Be gentle, I've only had my PB a week!

    To help you in your quest to keep your hands on the keyboard you should check out apps like LaunchBar and Quick Silver. Your hands will never (well... rarely) leave the keyboard again.

  • Another question about adding music to iPhone

    Apologies for yet another question regarding adding music to an iPhone but I am completely stuck.
    I bought a new laptop in January (it runs windows 8). I've authorised it and synced my phone to it before. I've used it to add music before.
    Lately I've just been buying music directly from itunes on my phone but I wanted to add some music from my older collection that is on an external harddrive.
    I've gone through the process of syncing the phone again, which has wiped whatever was on there. I made sure I'd ticked on the "manually manage music" box. 
    It's put all my purchased music back but it still will not let me drag and drop music from my external harddrive. When I hover over with the file it has "link" but it won't actually send the music to the phone.
    Is there a way for me to do this without putting music on to my itunes library? I don't like itunes and I definitely don't want to add the music to my laptop as it defeats the purpose of having an external harddrive! Sorry for such a long-winded explanation.

    Just to add... I've now tried adding music to the library (getting desperate here) and it's not letting me do that either. Just says 'link'.
    This is the most frustrating thing ever. Why are the simplest of tasks made so difficult? It seems like it only works if you buy the music from the iTunes store.

  • Question about adding an Extra Node to SOFS cluster

    Hi, I have a fully functioning SOFS cluster, with two nodes, it uses SAN FC storage, Not SAS JBODS. its running about 100VM's in production at the moment.
    Both my nodes currently sit on one blade chassis, but for resiliency, I want to add another node from a blade chassis in our secondary onsite smaller DC.
    I've done plenty of cluster node upgrades before on SQL and Hyper-V , but never with a SOFS cluster. 
    I have the third node fully prepaired, it can see the Disks the FC Luns, on the SAN (using powerpath, disk manager) and all the roles are installed.
    so in theory I can just add this node in the cluster manager and it should all be good, my question is has anyone else done this, and is there anything else I should be aware of, and what's the best way to check the new node will function , and be able
    to migrate the File role over without issues. I know I can run a validation when adding the node, I presume this is the best option ?
    cannot find much information on the web about expanding a SOFS cluster.
    any advice or information would be greatfully received !!
    cheers
    Mark

    Hi Mark,
    Sorry for the delay in reply.
    As you said there is no much information which related to add a node to a SOFS cluster.
    The only ones I could find is related to System Center (VMM):
    How to Add a Node to a Scale-Out File Server in VMM
    http://technet.microsoft.com/en-us/library/dn466530.aspx
    However adding a node to SOFS cluster should be simple as you just prepared. You can have a try and see the result. 
    If you have any feedback on our support, please send to [email protected]

  • Question about adding a line/phone to a new plan

    Hey everyone I have a concern I wanted to be clear about before I upgrade my plan. I am up for a device upgrade and plan on upgrading my smartphone and my current single line plan to one of of the new share everything family plans and a new smartphone. I can get the phone I want at a different store other then verizon for a better price so Im going to do that. After that is all said and done I plan on buying and adding another new smartphone/line to my share everything account through verizon(store or online). I just want to be sure that 1.) Adding another line after the fact isnt going to be a problem fee wise or the terms of my account wise since I just upgraded my account at a different vendor and 2.) Will that new line be still eligible for a upgrade discount through verizon just like a new plan would be even though Im not adding it at the same exact time I upgrade my main phone and plan?
    Also I was wondering that if..say a few months from now I want to add another new phone/line to my share everything account. Will that also be like a new plan and eligible for a upgrade discount through verizon? My 2.) question will probably answer this but I want to be absolutely sure first before I do anything. Thanks alot guys. Appreciate any input.

    scottm79 wrote:
    Hey everyone I have a concern I wanted to be clear about before I upgrade my plan. I am up for a device upgrade and plan on upgrading my smartphone and my current single line plan to one of of the new share everything family plans and a new smartphone. I can get the phone I want at a different store other then verizon for a better price so Im going to do that. After that is all said and done I plan on buying and adding another new smartphone/line to my share everything account through verizon(store or online). I just want to be sure that 1.) Adding another line after the fact isnt going to be a problem fee wise or the terms of my account wise since I just upgraded my account at a different vendor and 2.) Will that new line be still eligible for a upgrade discount through verizon just like a new plan would be even though Im not adding it at the same exact time I upgrade my main phone and plan?
    Also I was wondering that if..say a few months from now I want to add another new phone/line to my share everything account. Will that also be like a new plan and eligible for a upgrade discount through verizon? My 2.) question will probably answer this but I want to be absolutely sure first before I do anything. Thanks alot guys. Appreciate any input.
      Every time you add a line, it is eligible for a subsidized phone. It does not matter when you do it. As far as question #1, your account is just what the terms of usage is, not the length of the contract(s). Those are determined by the individual lines. You can also change the account limits at any time (eg. increase shared data limit), but when you do, it is usually pro-rated for the remainder of your current billing month, plus 1 month in advance. It does not change any of the lengths of the lines contracts.
      Does this help?

  • A noob question about precedence...

    Ok, here's the question.
    let's say:
    int a=0;
    a=a++;
    when a is evaluated, 0 is returned.
    isn's that expression like this?
    a=a=0;
    a=a+1;
    apparently I'm wrong.
    so if i forced a parentheses on it
    a=(a++);
    but again, a is evaluated as 0,
    I know how ++a would work, but i'm really curious about the suffix one.
    can any one explain to me?

    i mean how no matter what u do to
    a=a++
    i know in this case that a is evaluated first b4 it is added to 1,
    but it's gona add that 1 eventually right? so the evaluation of
    a in the en should be 1.
    Ah, I'm so confused, help

  • Question about adding Windows 2012 R2 Domain Controller, into a native Windows 2008 R2 single forest domain

    I current have a two server domain, both Windows 2008 R2 and fully updated.   The two servers are on subnet 10.0.1.0 /24
    - Windows 2008 R2 Server A: 10.0.1.1 (DC, GC, FSMO, DNS)
    - Windows 2008 R2 Server B: 10.0.1.2 (DC, GC)
    AD Domain: COMPANY.LOCAL
    I have a second connected subnet, 192.168.1.0 /24) which is routed to the 10.0.1.0/24 subnet and I would like to install a Windows 2012 R2 server onto a server on that subnet and make it a domain controller with AD-Integrated DNS and DHCP for the 192.168.1.0
    /24 subnet.
    - Windows 2012 R2 Server C: 192.168.1.1
    What are the proper progression steps, in order to bring up the Windows 2012 R2 server and then add it to my COMPANY.LOCAL domain and then promote it do a DC/GC/AD-Integrated DNS server?   Are they anything like the following:
    1. Install Windows 2012 R2 server (Server C)
    2. Point Windows 2012 R2 server DNS servers at Server's A and B
    3. Perform AD prep to extend AD schema to support Windows 2012 R2 domain controllers
    4. Promote Windows 2012 R2 server to domain controller (install local DNS service on Server C, during this step)
    * Question:  Will Windows automatically create a DNS zone for the Windows 2012 R2 subnet (192.168.1.0/24) AND also include the DNS zone from the previous Windows 2008 R2 domain (10.0.1.0 /24)?  Or will I need to add the 10.0.1.0 /24 zone to the DNS
    server on Server C, even though the DNS from the Windows 2008 R2 domain is AD integrated?

    Hi,
    Regarding the issue here, please take a look into below articles:
    System Requirements and Installation Information for Windows Server 2012 R2
    http://technet.microsoft.com/en-us/library/dn303418.aspx
    Release Notes: Important Issues in Windows Server 2012 R2
    http://technet.microsoft.com/en-us/library/dn387077.aspx
    Install a Replica Windows Server 2012 Domain Controller in an Existing Domain (Level 200)
    http://technet.microsoft.com/en-us/library/jj574134.aspx
    Here is an example for promoting Windows Server 2012 to a DC, see:
    Step-by-Step Guide for Setting Up A Windows Server 2012 Domain Controller
    http://social.technet.microsoft.com/wiki/contents/articles/12370.step-by-step-guide-for-setting-up-a-windows-server-2012-domain-controller.aspx
    As the server is promoted to a DC, DNS Zones will be replicated and synchronized to it automatically whenever the new one is added to an AD DS domain,  bascially there is no special need to add zones,  for more information, please see:
    Understanding Active Directory Domain Services Integration
    http://technet.microsoft.com/en-us/library/cc726034.aspx
    Hope this may help
    Best regards
    Michael
    If you have any feedback on our support, please click
    here.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • Noob question about trying to duplicate rows in a table

    Simplification of problem is I've got a table with user_id, name, year where user_id is pk. I would like to take all the rows that match year=2008 and insert them into the same table, but start the user_id at a certain number and set year=2009.
    I know this doesn't work, but it's what I want to do in noob-code:
    INSERT into TABLE (
    user_id, name, year
    ) VALUES (
    SELECT user_id_seq.nextval after starting at 3500, name, 2009 from same table doing insert to where year = 2008
    I've contemplated using a temporary table, I've also seen mention of cursors, but don't quite understand what they are. I'm really, really new to Oracle and SQL in general, but am familiar with programming and shell scripts. I know more in depth searching might land me what I want, but I think my search syntax would be just as weak as my knowledge of the material. I'm just thinking this is something so basic and easy that my searches aren't using the right terms to catch a hit.

    Hi,
    Welcome to the forum!
    You can INSERT all the results of a query by substituting the query where you otherwise would have "VALUES (list)".
    For example:
    INSERT into TABLE_X
           (user_id,              name,  year)
    SELECT  user_id_seq.NEXTVAL,  name,  2009
    FROM    table_x
    WHERE   year = 2008;This assumes that the sequence user_id_seq exists and is ready to issue the correct value. (It's unclear if that's part of the problem.)
    Temporary tables and cursors (which are a way of getting query results in PL/SQL) are only useful for inserting in rare situations, where you have to do very odd, convoluted things. Think (at least) twice about how to do what you need to in SQL, and if you can't think of a way, then ask.
    Yes, basic things often are hard to search for, especially if you don't know the right terms.
    There are several good teach-yourself SQL books that explain this kind of thing. Getting one would be a good investment.
    [All the Oracle manuals|http://www.oracle.com/pls/db111/portal.all_books] are on line. There's an example of this in the SQL Reference manual, under THE INSERT command.
    Edited by: Frank Kulash on Nov 26, 2008 12:59 PM
    Clarified usefulness of cursors. They have a lot of good, common functions, but helping with INSERTs is not one of them.

  • Noob question about Airport

    I have one of the early G5 PowerMacs (single 1.6 gHz). It currently doesn't have an Airport card, but I'd like to install one or an equivalent. Here's my two questions:
    1.) Are all G5s compatible with Airport Extreme cards?
    2.) Are there good third party alternatives out there?
    I wish Apple would be clearer about what systems are "Airport Extreme Ready".
    Thanks in advance!

    The Airport "Extreme" card for your G5 is here
    http://store.apple.com/1-800-MY-APPLE/WebObjects/AppleStore.woa/wo/1.RSLID?mco=3 93BD37&nplm=M8881LL%2FA
    An alternative here but no cheaper
    http://www.macwireless.com/html/products/11g11bcards/11gPCI.php

  • Noob question about HDR images

    hi everybody! i am reading this book about photoshop hoping to understand a lot more than i already know about pixels and colors and image dinamics and such..i got to the chapter about HDR images and here's what i dont get. as i understand, given a HDR image it has 32 bit depth meaning its file contains much more information about contrast and brightness than any existing monitor can output, so when u open it in photoshop u will never see its true quality. my question is( and i admit it may seem pointless to some, but i am committed to understand the cause and purpose), when converting it to 8 or 16 bit depth this window pops up asking me to tweak gamma, exposure, shadows and highlights, etc., but why is this linked to the conversion process? why not simply convert it, maintain the same appearance as before and then if needed manually adjust using all the image controls from the photoshop menus? i have CS6, if that matters.

    I don't know if this will help, but I've heard about HDR monitors (still very expensive), which supposedly very accurately display the HDR values. If you hang one on the wall in your house, people might think it's a window, since it is literally a source of light, in the same way a window to the outside world is.
    Possibly the most surprising use of HDR imagery is in 3D apps where global illumination models are used. HDR imagery literally is the only source of light for these images. There are no lights in the scene, only HDR imagery. This is because of the great dynamic range of HDR.
    A more practical (to me) use of HDR is when resurrecting antique images. If you scan multiple exposures from old prints, then create HDR, sculpting values in 16-bit becomes a very powerful tool, only due to the HDR value range.
    Photoshop, although it can edit very well in 16-bit, can only show 8-bit representations of HDR imagery, since almost all monitors are 8-bits per channel. Because of the monitors, we can only see a small part of what is actually present in the HDR file.
    I've never done it, but I imagine that if we all had HDR monitors, we'd need to wear protective glasses (like you wear driving in your car when the sun is out) most of the time to do our work.  :+)

  • Noob question about DIV tags

    Learning DW and CSS so patience is in order .
    I've being reading numerous posts here and on the web about avoiding tables for laying out web pages. I can see the advantages in terms of cleaner codes and easiness of updating and changing sites at a later time. So I started learning about DIV tags (although tables is very easy for me) and have practice a few times with fairly good results, love the absolute positioning with it. Having said that, for the love of me, can't find a way of centering horizontally a page designed with DIV tags (due to ignorance), for example, 1 column/three rows page, after defining styles, size and colors I enclosed everything in another DIV tag, wrapper I think is called, but have not found a way of centering it on the page, text-aligment on the DIV tag only centers the text not the DIV itself, how to go about this? Help is appreciated.

    love the absolute positioning with it.
    Get over it.  It's a trojan horse.  Absolute positioning is not a general layout method.
    To center ANY block (non-absolutely positioned) element, use CSS to give it a width and left/right margins of 'auto'.  For example -
    <div id="foo">...</div>
    That div will be centered with this CSS -
    #foo { width:300px; margin:0 auto; }
    I think you are on the wrong path already, though.  Stick with tables (which you say are very easy for you) UNTIL you a) understand CSS well enough to understand what absolute positioning is and why I say it's bad, and b) understand how to use float, margin, and padding to place things on the page.  Then you are ready to move away from tables.

Maybe you are looking for