Return to Base State

Hello,
I have a Flex canvas that contains several buttons. When I
click the button it changes to the next state which brings up a
custom component that has a panel with buttons on it. One of the
buttons should close the panel and return to the original state.
The exit button is a blue square and here is the actionscript:
private function onBlueClick ( event:MouseEvent ):void {
this.currentState=" ";
Unfortunately, this gives me an "undefined state" error. Does
anyone know how I can return to the base state through the
actionscript of a custom component?
Thanks in advance for any help.

the problem is you are calling a state change on your custom
component, and it has no states defined. You want to call the base
state in the main app (parent app).
Try something like Application.application.currentState = "";
Having said that, you should look into simply dispatching an
event from the component's button click back to the main app, and
have the main app handle the event to switch the state. A component
should not be controlling the main app like what you are trying as
this will lead to issues where the component is too
"tightly-coupled" to the main app.

Similar Messages

  • I had my iphone 4 locked to vodafone uk carrier. I connected the phone to itunes on my pc and tried to update the version to ios 6 through itunes. But it has been locked and asks for sim of previous carrier. how can i return to previous state?

    I had my iphone 4 locked to vodafone uk carrier. I connected the phone to itunes on my pc and tried to update the version to ios 6 through itunes. But it has been locked and asks for sim of previous carrier. how can i return to previous state?

    You cannot return to previous state. The update re-locked the iPhone
    to the original carrier. You must contact the original carrier to see if
    they offer unlocking and if you qualify.
    What does it say when you look at Settings=>General=>Carrier?
    Be advised that if your iPhone had previously been hacked/modified/
    jailbroken to work with other than original carrier, it may be impossible
    for the original carrier to unlock it properly.

  • I bought an ipad mini from some guy returning to the states and when i upgraded its os version its now asking for his apple id which i dont have. what should i do

    i bought an ipad mini from  some guy returning to the states and when i upgraded its os version its  now asking for his apple id which i dont have. what should i do

    That is Activation Lock.
    You have to contact the previous owner to have him remove it
    Find My iPhone Activation Lock: Removing a device from a previous owner

  • Apex 4.0 display image item :BLOB column returned by SQL statement

    Hello
    I'm creating an display image item in apex 4.0. The source is a BLOB column returned by SQL statement.
    When I'm issuing an sql statement like this:
       select lado.blob_content
       from   large_documents      lado
       ,        large_doc_headers    ladh
       where lado.ladh_nr = ladh.nr
       more criteriait works fine.
    When I create a function inside a package with the same query (in a cursor)
    function get_image(some parameters in) return blob
    Following in apex by:
    select get_image(some parameters) from dualI get a
    ORA-06502: PL/SQL: numeric or value error: character string buffer too smallAnybody any idea why this does not work?
    Regards Erik

    Hi Eric,
    the environment assumes varchar2-output by default, which will be limited to 32767 characters and may have problems with binary formats. You could define a blob-variable to select the value into.
    DECLARE
      l_blob BLOB;
    BEGIN
      SELECT get_image(some parameters)
        INTO l_blob
        FROM dual;
    END;
    /If you expect the BLOB-Content to be text (you should consider CLOB then), you may use UTL_RAW.CAST_TO_VARCHAR2 to convert the content. If your object is larger than the maximum varchar2 size, or you want to convert BLOB to CLOB, you might be interested in some converter like described here: {message:id=559749}
    Hope this is what you were searching for.
    -Udo

  • Returns to the state of departure

    Hi
    When I reload the browser page it returns to the state of departure set in Flash Bilder even if it is for the authentication state of the beginning and we lose the session.
    I used Flash Bilder

    No.

  • [feature request] Editing base states in design mode

    Please tell me the the new Flash Builder Burrito will have the ability to edit the base state while in design mode, or at least have the ability to "make same in all states" like in Flash Catalyst.
    I really loved the old method where you could make a state based on another one. This added an enormous amount of functionality to the design mode. I realize the Flex 4 state concept doesn't support this, but maybe that could be added back in on an IDE level using state groups.
    Anyways, I love what you're doing with Burrito. Keep up the great work!

    Thanks, Jim! It is a very blog-like post. (I still haven't gotten around to starting a blog but keep thinking I should.)
    I figured the clearer and more thought-out the presentation, the greater the likelihood it might get implemented. Also, I was originally stuck on Scenario 1 as a solution, and writing this helped me see other options.

  • Advantages of empty Application Base State?

    Several examples are coded where the Main.mxml base state is
    empty and there is a child state called e.g. main App (start)
    containing the initial gui components. (These examples are based on
    the Flex multi-window architectures).
    Does this make cleaner coding? Because one could obviously
    jump straight into things without the extra child state?
    TIA.

    Use currentState='' (that's two single quotes)

  • Is it possible to restore to ios5 after updating to ios6 when my phone returned to locked state to unlocked state. Pla help...

    Is it possible to restore to ios5 after updating to ios6 when my phone returned to locked state to unlocked state. Plshelp...

    Sounds like your iPhone was hacked/modified/jailbroken to work
    with wireless carrier other than the one it was purchased from. The
    update has relocked it to the original carrier. Contact the original
    carrier to see if they offer unlocking and if you qualify - only the
    carrier to which the iPhone is locked can unlock it.
    What does it say when you look at Settings=>General=>Carrier?
    Be advised that the previous modifications to change from original carrier
    to your current Carrier may have rendered the software unable to be
    officially unlocked and may prevent future updates.
    Reverting to a previous version of iOS is not supported. Even it it was,
    such reversion would not solve your problem because the iPhone has become
    relocked to the original wireless provider and that status will not change
    no matter what iOS version is installed.

  • How would you change the state to the base state?

    How would you change the state to the base state? Its not
    letting me do something like:
    currentState='<Base State>';

    Sorry about the vagueness of that last reply :)
    What I have done now in my code is this:
    viewstack1.addChildAt(loginCanvas,0);
    toggle.selectedIndex = 0;
    However nothing happens at this line of code:
    toggle.selectedIndex = 0;
    but this works:
    toggle.selectedIndex = 1; or ...
    toggle.selectedIndex = 2;
    toggle.selectedIndex = 3;
    toggle.selectedIndex = 4;
    toggle.selectedIndex = 5;
    toggle.selectedIndex = 6;
    The strange thing is that if I have a button on the screen:
    <mx:Button x="10" y="3" label="Button"
    click="toggle.selectedIndex =0"/>
    and the user clicks it the toggle.selectedIndex = 0; works.
    I'm stumped, any ideas?

  • How do I handle NULL returns from prepared statement?

    Thanks in advance to all those who respond. As a beginner with Java/JSP/JDBC, I need all the help I can get!
    Here's the problem...
    I'm using a prepared statement in JSP to query a MySQL database.
    If there is a value to return, everything works properly.
    If the query returns a NULL (empty set) value, I get the following error:
    javax.servlet.ServletException: Before start of result set
    Here's the code (no negative comments please...I know I'm violating some conventions! I'll restructure it later. Right now I just need help with handling the NULL case):
    <%
    Driver DriverAppt = (Driver)Class.forName(MM_test_DRIVER).newInstance();
    Connection ConnAppt = DriverManager.getConnection(MM_test_STRING,MM_test_USERNAME,MM_test_PASSWORD);PreparedStatement StatementAppt = ConnAppt.prepareStatement("SELECT lastname FROM appts_pid1 WHERE user_id = " + Recordset1__MMColParam + " AND year = " + yy + " AND month = '" + months[mm] + "' AND date = " + dates[dd] + " AND appttime = '16:15:00'");
    ResultSet Appt = StatementAppt.executeQuery();
    boolean Appt_isEmpty = !Appt.first();
    boolean Appt_hasData = !Appt_isEmpty;
    Object Appt_data;
    int Appt_numRows = 0;
    %>
    Thanks for the help!!!

    I think I have a better handle on what's occurring here. To cut to the heart of the problem, I'm going to give a very simple example that illustrates what type of error handling I need.
    HERE'S THE EXAMPLE:
    Let's say that I have a database of users. There are only two columns in the database: user_id and lastname. There are only 2 users, user_id "1" has lastname "Jones" and user_id "2" has lastname "Smith".
    I built a very simple web interface that let's a user enter a number to see if there's a lastname associated with that record. The user has no way of knowing if the user_id exists or not, so they may or may not enter a valid number.
    If the user enters a valid user_id (in this case "1" or "2"), then the correct lastname is displayed. If the user enters an invalid user_id (in this case, anything other than "1" or "2") then I get the same "Before start of result set" error that I'm getting in my real application.
    So, the question is: WHERE IN THIS CODE WOULD I HANDLE THE RETURN OF AN EMPTY SET?
    The goal here is to have the sentence say "The user's lastname is .", basically returning null. If there has to be a value, then have the last sentence say "The user's lastname is unknown."
    If you can solve this simple example, you'll have also solved the problem with my main application!!!! :-)
    Here's the example code:
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
    <%@ include file="Connections/example.jsp" %>
    <%
    String Recordset1__MMColParam = "1";
    if (request.getParameter("user_id") !=null) {Recordset1__MMColParam = (String)request.getParameter("user_id");}
    %>
    <%
    Driver DriverRecordset1 = (Driver)Class.forName(MM_example_DRIVER).newInstance();
    Connection ConnRecordset1 = DriverManager.getConnection(MM_example_STRING,MM_example_USERNAME,MM_example_PASSWORD);
    PreparedStatement StatementRecordset1 = ConnRecordset1.prepareStatement("SELECT * FROM test_table WHERE user_id = " + Recordset1__MMColParam + "");
    ResultSet Recordset1 = StatementRecordset1.executeQuery();
    boolean Recordset1_isEmpty = !Recordset1.next();
    boolean Recordset1_hasData = !Recordset1_isEmpty;
    Object Recordset1_data;
    int Recordset1_numRows = 0;
    %>
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body>
    <form action="test.jsp" method="get" enctype="application/x-www-form-urlencoded" name="form1" target="_self">
    <p> Submit a user id and a lastname will be displayed.</p>
    <p>
    <input type="text" name="user_id">
    <input type="submit" name="" value="Submit">
    </p>
    </form>
    <p>The User's lastname is <%=(((Recordset1_data = Recordset1.getObject("lastname"))==null || Recordset1.wasNull())?"":Recordset1_data)%>.</p>
    </body>
    </html>
    <%
    Recordset1.close();
    StatementRecordset1.close();
    ConnRecordset1.close();
    %>
    A huge "THANK YOU!!!!" to all those who've helped me here!!!

  • Ignore carriage returns in select statement

    Within Oracle Report builder, I am using a select startment
    select descr
    from atable
    "descr" contains carriage returns at the end of the input ie people have enter 'enter' when inputting the data.
    how do write the select statement to ignore the carriage return 'enter' contain within "descr".
    Thanks

    SQL> SELECT 'aa' || chr(10) || 'bb' c FROM dual;
    C
    aa
    bb
    SQL> SELECT translate('aa' || chr(10) || 'bb', chr(10),' ') c FROM dual;
    C
    aa bb
    SQL> SELECT 'aa' || chr(13) || 'bb' c FROM dual;
    C
    aa
    bb
    SQL> SELECT translate('aa' || chr(13) || 'bb', chr(13),' ') c FROM dual;
    C
    aa bb
    SQL> "For Windows"
    Message was edited by:
    mennan
    Message was edited by:
    mennan

  • Screen blacks out after a few seconds and won't return to normal state.

    I have the 30 gig ipod photo that i got about a year and a half ago. Whenever I look at the screen to access music or anything, the screen blacks out like there's a screensaver or something and won't return back to normal. Even after I reset it, it stays normal for a few seconds and then blacks out again. The backlighting still works so it's just a bright black screen and I have function of the click wheel because it clicks everytime I move up or down. I already tried restoring it so I am all out of options. Anyone PLEASE HELP!!! Thanks
    Steve

    This happens rarely but consistently! I't seems to happen about 5% of the time waking from sleep. It MAY be more prone to happen if I had been moving with it in my bag, but it can happen at any waking time after any duration of sleep.

  • Can't read iPhoto library from external drive via airport extreme base stat

    I can't seem to open my iPhoto library from my external USB drive that is hooked and being shared through my airport extreme base station. If I plug the external drive directly to my mac via USB it works but not when going through the base station.
    This only started happening when I upgraded from iLife'06 to iLife'08.
    Anyone have any ideas on how to fix?

    That's a problem that many are posting about. Haven't read of a solution yet. Be sure to report the problem to Apple at: http://www.apple.com/feedback/iphoto.html.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've written an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 08 libraries. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.

  • Xsl:include return incorrect base url

    I am using FOP to generate PDF file in servlet.
              I have 2 stylesheets (e.g. a.xsl and b.xsl), they are located in <myapplication>\webapp\application\stylesheet.
              In a.xsl, it includes b.xsl:
              <xsl:include href="a.xsl"/>
              When I test the stylesheet in the command line (dos prompt), it runs fine. However, when I run it in weblogic (6.0), there is an error:
              org.xml.sax.SAXParseException: File "file://C:/bea/wlserver6.0/b.xsl" not found.
              The base url for b.xsl should be the same as a.url. I believe there is a bug in weblogic, isn't?
              Is there anyone who knows how to resolve this exception?
              Thanks.
              - Christina
              

    'set' is a reserved word. So is your column 'values'. Always avoid using reserved words.
    MySQL :: MySQL 5.5 Reference Manual :: 9.3 Reserved Words

  • Using Spotlight to search USB drive connected to Airport Extreme base stati

    Hi all,
    I successfully connected a USB hard drive to my Airport Extreme base station (the drive has its own power supply; when I tried connecting a USB-powered drive, it wouldn't show up). However, I find that I cannot search the USB hard drive over the Airport network. That is not very convenient, to say the least. Is this possible without paying $500 for Snow Leopard server software or waiting for Lion (with a rumored built-in server function) to arrive?
    Thank you!

    My last response was incorrect. The base station is in the finder window, under "Shared." I click on that and then I see the USB driver. Also, I went to finder prefs and clicked to show servers on the desktop. So now the USB drive connected to the base station shows up on my desktop. But I still can't search it.
    Thanks again.

Maybe you are looking for