_root to AS3 - EASY ONE!

I swear I've googled all over for this before I posted.  I've tried things I've read, but nothing's worked (or made sense to me, for that matter).
What I have is pretty basic.  Trying to do what WOULD have been this in AS2:
mute_btn.addEventListener(MouseEvent.CLICK, onMute);
function onMute(e:MouseEvent):void {
     _root.soundbars_mc.gotoAndStop(2);
Both mute_btn and soundbars_mc are on the main timeline.  I can't get this to work, and I know it's easy.  Any help???
Thanks!

AS3 gets picky (aka stupid) at times, requiring you to tell it what it already knows anyways.  Try using...
MovieClip(root).soundbars_mc.gotoAndStop(2);

Similar Messages

  • Import statements-- Please clarify Easy one...For You

    Hi,
    Please clarify and i hope it would be easier one.
    I have imported two packages of same type like:
    import java.util.*;
    import java.util.*;
    in my programme and what will be the cause, i know that i dont get error, i wan to know that wat compiler will do>>>
    1. Whether it will tak more compilation time?
    2. It will take more memory?
    Please clarify???
    Thanks in Advance.

    1. Whether it will tak more compilation time?Probably not
    2. It will take more memory?No

  • Getting redirect to work  -- easy one?

    Hopefully this is an easy one for someone to answer -- I'm simply trying to set up an action-mapping that performs a redirect instead of a forward. If I use the following xml in struts-config.xml (I'm using struts-faces), then everything "works":
    <action
    path="/search"
    type="com.wheels.struts.SearchAction"
    name="searchForm"
    scope="request"
    input="search">
    <forward
    name="results"
    path="faces/results.jsp"
    />
    </action>
    I get an error if I change the forward to be a redirect, however, as in:
    <action
    path="/search"
    type="com.wheels.struts.SearchAction"
    name="searchForm"
    scope="request"
    input="search">
    <forward
    name="results"
    path="faces/results.jsp"
    redirect="true"
    />
    </action>
    The error I get is:
    java.lang.IllegalStateException: Cannot forward after response has been committed
    Any thoughts on this one? Is there something I need to change in my Action class to properly redirect instead of forward? Something in struts-config.xml??
    Thanks very much.
    -Adam

    I would agree this is probably an easy one, but only on the STRUTS-USER mailing list :-). To subscribe, send an empty message to [email protected] Alternatively, you can find links to various archive sites for previous postings on this list at:
    http://nagoya.apache.org/eyebrowse/SummarizeList?listId=42
    Craig

  • Hopefully this is an easy one

    Hopefully this is an easy one. how do you disable timed slide advance in Captivet 3? I have not been able to find it anywhere. Thanks

    Welcome to the all volunteer Captivate forum.  Several options.
    - Add <Back and Next> buttons on each slide manually
    - Place click boxes on the screen.  This is a neat way to do it because the click box can be the entire screen with a 100% transparency.  However, users must know to click the screen to advance and then there is no <Back or rewind type option
    - Correct interactions can be added with click boxes.  Use Captions to ask the user to do something and when they click the right place, the series advances.
    Hope this helps a bit.
    Joe C.

  • A REAL easy one-display 10

    Greetings;
    This should be an easy one, just one that is driving me crazy.
    I have 10 instances from 2 tables displayed on a form. The first field is to enter a stock number, the second field looks up the description in a reference table. This works fine in the first row, but, when a stock number is entered in the second row, instead of entering a description in the second row, the description in the first row is "updated". Please, what am I missing??

    I'm not sure I got it right.
    Does that mean you have 2 data blocks? If so, it's quite clear that, when being in the first block and refferencing the items in the second, that would have effect on the record that is current in the second block, that, in your case happens to be the first record.
    If it is like I imagine, then you should put both fields (including the refferenced one(s)) in the same data block with a data source set as the table you update, but have the refferenced field(s) set as non-database item. The refferenced field(s) are to be populated through a select in the post-query trigger on the given block, or, eventually in when-validate-item.
    Sorry, but if this can't help you, you should study more and especially be more specific in what you ask.

  • Easy one for someone, I hope

    This is probably an easy one for someone:
    I have a simple password function in a child movie and am
    using the standard code to activate the enter key
    on (release, keyPress "<Enter>") {
    It works fine on it's own, but doesn't work when it's loaded
    into the parent movie. What's the solution?
    Simonster

    create a submit button that works the same as the keypress
    Dan Mode
    *THE online Radio*
    http://www.tornadostream.com
    *Must Read*
    http://www.smithmediafusion.com/blog
    *Flash Helps*
    http://www.smithmediafusion.com/blog/?cat=11
    "Simonster" <[email protected]> wrote in
    message
    news:e940j1$a8o$[email protected]..
    > This is probably an easy one for someone:
    > I have a simple password function in a child movie and
    am using the
    > standard
    > code to activate the enter key
    >
    > on (release, keyPress "<Enter>") {
    >
    > It works fine on it's own, but doesn't work when it's
    loaded into the
    > parent
    > movie. What's the solution?
    >
    > Simonster
    >

  • This is an easy one: One Apple TV with two Account (MusicMatch and PhotoStream)

    Hi,
    How can I setup Apple TV with my iTunes Account (for music, movies, etc) and a different iCloud account for Photostream. This is easy in IOS and OS devices, but I could not figure this out on Apple TV. Apple TV configuration takes the iTunes account and uses it as the default for music match and Photostream, can this be different?
    If not how can I merge the two with least hassle.
    Thanks.

    That isn't correct, when you go to setup photo stream, it asks you if you wish to use the account associated with the iTunes store, or use a different one.

  • How to _root in as3 (buttons in movie clip referencing to main timeline)

    Hi, I created buttons within a movie clip that i placed in the main timeline.I am  a novice to as3. I just wanted the button to go to the frame label of the main timeline. i used to do this with _root in the old flash. how do i do this?
    thumb02_btn.addEventListener(MouseEvent.CLICK, buttonClicked);
    function buttonClicked(event:MouseEvent):void
        gotoAndPlay("slide2");

    Thanks for the quick reply!
    somehow i must be doing something wrong though. It's not working...
    I added a stop to the "slide02" labeled section of the main timeline.
    and I also added a stop to the beginning and end of the movieclip. Am I doing something wrong? attached is my file....thanks!!
    stop();
    thumb02_btn.addEventListener(MouseEvent.CLICK, buttonClicked);
    function buttonClicked(event:MouseEvent):void
        MovieClip(this.root).gotoAndPlay("slide2");
    stop();

  • Easy one (?) - multiple results in one query

    Hi,
    I am trying to return multiple (say, 2) columns, each column containing the result of one query; executed in one statement.
    Basically the following set of subqueries is working, but I would like to know if there is an easier, less cumbersome way?
    select
    (select count(field1) from table1) as count1,
    (select count(field2) from table2) as count2
    from dual
    I tried the UNION ALL but it returns multiple rows.
    Ah well, it works but the 'from dual' seems a little odd to me.
    Cheers.

    thanks - I just looked at the 'from dual', and wondered if I would really need to make it a subquery.
    Ah well, thanks for the reply.

  • 16 x9 viewer: I think this is an easy one?

    I'm working on an independent (super low budget) feature length documentary but am new to Final Cut after having been an AVID editor for a PBS station for the last 8 years.
    I opened the software for the first time and my viewer windows are in 4 x 3 aspect ratio - I looked for the simple setting change that will change it to 16 x 9 but am not able to locate it. I know it's gotta be there somewhere.
    Thanks!

    You need to set up FCP using an easy set up that you elect when you first open the app.
    That would likely be the 1080i/60 HDV set up.
    You can change this by hitting command-I and clicking on the easy set up button and getting the right one.
    Might want to start with a basic book on FCP.

  • E17 edge resistance question (solved, easy one!)

    hey guys,
    I have wanted to like enlightenment for a long time, and both it and I have progressed enough that it is my primary desktop, with only a few annoying issues.  The biggest one is concerning desktop switching. I do not want to be able to flip to a new desktop by moving the cursor to the edge of the screen.  With other pagers I have been able to turn that behavior off.  With the e17 module, I can't figure out how, or whether it is even possible. I've adjusted edge resistance and some other things but no luck.
    Help? Thanks.
    Last edited by scrawler (2011-04-01 10:05:13)

    I will try that. And I'm embarrassed, a little.  I searched, honest!  I've been using duckduckgo as a search engine lately, so the search results were not as good as yours.  Yeah, that's the excuse I'm going with.
    Thanks a lot.  Easy answer or complex, I've found that sometimes it just takes asking.
    edit: worked like a charm.  I'm all giddy now, thanks again.
    Last edited by scrawler (2011-04-01 10:04:18)

  • Probably a really easy one - please help!

    Hi everyone,
    What i have is a country class:
    import java.awt.*;
    class Country {
         static int count = 0;
         private String name;
         private int population = 0;
         private int xCoord, yCoord;
         public Country neighbours[];
         Country(String name, int xCoord, int yCoord) {
              this.name = name;
              this.xCoord = xCoord;
              this.yCoord = yCoord;
              count++;
         //public void Paint(Graphics g) {
         //     g.drawString(population+"", xCoord, yCoord);
         static int getCount() {
              return count;
         public String getName() {
              return name;
         public void setNeighbours(Country[] neighbours) {
              this.neighbours = neighbours;
    In my main main program i have the following methods:
         public void paint(Graphics g) {
              super.paint(g);     update(g);
         public void update(Graphics g) {
              g.setColor(Color.black);
              g.drawRect(6,24,801,399);
              g.drawImage(now,7,25,null);
    In the main program there is a main image (a map of the world), which is re-drawn now and again. My problem is that in the country class, i want to add a paint method so that for each instance of the country class, the population should be painted on top of the main image in the appropriate place. This is probably really easy to do but i am having big problems, ive tried putting a paint method in but it obviously needs to be more sophisticated than that - can anyone help?
    Many thanks
    Cath

    This is Java, not C#. There's nothing magical in the method names - your class does not become a graphical component just because you define a method called paint(Graphics). A method is a method is a method.
    You could give the method that draws the country on a Graphics object a name like drawYourSelf(Graphics) and then call "someCountry.drawYourSelf(graphicsObject)" in the paint method of some Component (= your "main program"?). But the method can well be called "paint" or "Paint" or "hr_7Guj8T�GYr" as well if you just call it from the paint method of some Component.
    I'm afraid that you are doing one of worst things there is: mixing GUI with business logic. Are countries necessarily things that have a name, population, x coordinate, y coordinate, 0 or more neighbours, and that can be drawn on something?
    OTOH, if your Countries are really GUI components, they should probably inherit from java.awt.Component

  • An easy one for most of you... but for me... .???

    Post Author: cmainard
    CA Forum: Formula
    if (CDateTime (2007, 07, 31, 00, 00, 00)-{Nameadd.Start Date})<365 then "Annualized since Inception - " else "Since Inception - "
    the above formula works just fine.... but I want to show the actual start date referenced in nameadd.start date at the end of the text, which grows and shrinks.... but I cannot figure out how to add this, since it keeps telling me it should be a string???
    this is what I tried and does not work:
    if (CDateTime (2007, 07, 31, 00, 00, 00)-{Nameadd.Start Date})<365 then "Annualized since Inception - " + {Nameadd.Start Date} else "Since Inception - " + {Nameadd.Start Date} 
    How can I add my datetime field to end of the resultant text?  should be easy, but I cant get it.
    THANKS!!

    Post Author: cmainard
    CA Forum: Formula
    I can't tell you enough how much this helps!
    I am getting one of those weird error messages, indicating a " number, currency amount, boolean, date, time, date time, or string is expected here"
    if (CDateTime (2007, 07, 31, 00, 00, 00) - {Nameadd.Start Date}) < 365 then "Annualized since Inception - " & totext(date({Nameadd.Start Date}),u201DMM/dd/yyu201D)
    else "Since Inception - " & totext(date({Nameadd.Start Date}),u201DMM/dd/yyu201D);
    betweein the comma and the quoute here:  totext(date({Nameadd.Start Date}),u201DMM/dd/yy

  • Easy one for you, I think

    Hi ya'll.... here is an easy question for all you Dreamweaver
    gurus out there. I want to write my website to a CD so that anyone
    with any web browser can read it. I created it in Dreamweaver. How
    do I accomplish this?

    If it's a static site, get yourself a copy of AutoRun CD.
    You burn two files to your CD along with your site files. One
    is the
    autorun.exe file. The other is an inf text file where you
    specify which file
    on the CD should load first.
    Probably index.html.
    http://www.rjlsoftware.com/software/utility/autorun/autorun.shtml
    --Nancy O.
    "cgarrison" <[email protected]> wrote in
    message
    news:f1b5g7$j3g$[email protected]..
    >
    > Hi ya'll.... here is an easy question for all you
    Dreamweaver gurus out
    there.
    > I want to write my website to a CD so that anyone with
    any web browser
    can
    > read it. I created it in Dreamweaver. How do I
    accomplish this?
    >

  • Regular expression question (should be an easy one...)

    i'm using java to build a parser. im getting an expression, which i split on a white-space.
    how can i build a regular-expression that will enable me to split only on unquoted space? example:
    for the expression:
    (X=33 AND Y=44) OR (Z="hello world" AND T=2)
    I will get the following values split:
    (X=33
    AND
    Y=34)
    OR
    (Z="hello world"
    AND
    T=2)
    and not:
    (Z="
    hello
    world"
    thank you very much!

    Instead of splitting on whitespace to get a list of tokens, use Matcher.find() to match the tokens themselves: import java.util.*;
    import java.util.regex.*;
    public class Test
      public static void main(String[] args) throws Exception
        String str = "(X=33 AND Y=44) OR (Z=\"hello world\" AND T=2)";
        List<String> tokens = new ArrayList<String>();
        Matcher m = Pattern.compile("[^\\s\"]+(?:\".*?\")?").matcher(str);
        while (m.find())
          tokens.add(m.group());
        System.out.println(tokens);
    }{code} The regex I used is based on the assumptions that there will be at most one run of quoted text per token, that it will always appear in the right hand side of an expression, and that the closing quote will always mark the end of the token.  If the rules are more complicated (as sabre150 suggested), a more complicated regex will be needed.  You might be better off doing the parsing the old-fashioned way, with out regexes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for