New scene after login success AS3

Hi guys,
I'm really new to actionscript so i have trouble in understanding the code. I tried many ways to go to a new scene after login successful but sadly failed. I followed one of the tutorials on the login part..It works and i'm happy wif it..but currently, it displays only the success message. Instead, i wanna go to a new scene but don't know how. I'll post the code below. Hope u can help ..I have a dateline for this project. Thanks!
[actionscript]
package actions {
    import flash.display.MovieClip;
    import flash.events.*;
    import flash.net.*;
    import flash.text.*;
    public class main extends MovieClip {
        public function main ():void {
            submit_button.buttonMode = true;
            submit_button.addEventListener(MouseEvent.MOUSE_DOWN, checkLogin);
            username.text = "";
            password.text = "";
        public function checkLogin (e:MouseEvent):void {
            if (username.text == "" || password.text == "") {
                if (username.text == "") {
                username.text = "Enter your username";
                if (password.text == "") {
                password.text = "Enter your password";
            } else {
                processLogin();
        public function processLogin ():void {
            var phpVars:URLVariables = new URLVariables();
            var phpFileRequest:URLRequest = new URLRequest("login.php");
            phpFileRequest.method = URLRequestMethod.POST;
            phpFileRequest.data = phpVars;
            var phpLoader:URLLoader = new URLLoader();
            phpLoader.dataFormat = URLLoaderDataFormat.VARIABLES;           
            phpLoader.addEventListener(Event.COMPLETE, showResult);
            phpVars.systemCall = "checkLogin";
            phpVars.username = username.text;
            phpVars.password = password.text;
            phpLoader.load(phpFileRequest);
        public function showResult (event:Event):void {
            result_text.autoSize = TextFieldAutoSize.LEFT;
            result_text.text = "" + event.target.data.systemResult;
[php]
<?php
include_once "dbconnect.php";
$username = $_POST['username']; //variables from flash
$password = $_POST['password'];
if ($_POST['systemCall'] == "checkLogin") {
$sql = "SELECT * FROM users WHERE username='$username' AND password='$password'";
$query = mysql_query($sql);
$login_counter = mysql_num_rows($query);
if ($login_counter > 0) {
print "systemResult=Welcome $username!";
} else {
print "systemResult=Invalid User!";
?>

You probably want to check the value that it returns and use it to decide whether to go to the next scene or not.
        public function showResult (event:Event):void {
            result_text.autoSize = TextFieldAutoSize.LEFT;
            result_text.text = "" + event.target.data.systemResult;
            if(String(result_text.text).indexOf("Welcome") == 0) {
                   gotoAndPlay(1, "Scenename");
What the first line does is checks to see if the word Welcome is at the start of whatever is in the textfield (starts at index 0).  If it does, then it issues the command to move to another frame/scene

Similar Messages

  • On new session after login procedure and :APP_USER

    Hi,
    I need to get some info using :APP_USER on a new session after login procedure but it's always null:
    I'm referencing it this way:
    my_var := :APP_USER;
    Any help is wecome
    For the forum moderator, I got some problems, could you please close 2 of my repeating treads. Thanks
    Message was edited by:
    Rafael M

    Hi Scott,
    I am facing the same problem. I have created one application process with process condition On New Session: After Authentication. In this application process i am checking for :app_user in particular table, if the person does not exist i am inserting a record in to the table. But every time :app_user is having null value with On New Session: After Authentication process condition. It is working fine for remaining process conditions.
    Thanks in advance for your help
    Regards
    Ram.

  • Clonned server did not open new form after login

    Hi experts,
    After login sucessfuly, when click any form, it did not open any new form and not return any form. Can you please
    help me in this case.
    Thanks

    Please check whether you have any errors in the database log file or not.
    I could not find any error regarding the issue. Please give me step by step if you can assist to sort out
    the issue. I have no much experience regarding such issue. So I need more clearance and step by step instructions.Please rename Apache log files, restart the services, then reproduce the issue and check the log files.
    Also, please check if you have any errors in Jinitiator/JRE console window.
    Thanks,
    Hussein

  • How can I display a new scene in JavaFX 2.2? For example after button click

    how to display new scene after button click in the main window, I want the main window and the new scene are in one stage. thx

    You can change the scene by calling stage.setScene(new Scene(newContentParent));
    I don't think you are quite asking for a complete scene change though as you "want the main window and the scene in one stage". The main window is a stage (as Stage extends Window). And a given stage can only contain one scene at a time (though you can swap it out by calling setScene as described earlier).
    What I think you are really asking for how can you replace some content part of the active Scene on the Stage. To do that you can set a layout manager like a HBox or a BorderPane as the root of your scene, then change out the content of the layout manager. For example:
    final BorderPane layout = new BorderPane();
    layout.setCenter(new Label("Dogbert");
    final Button nav = new Button("Next");
    layout.setLeft(nav);
    nav.setOnAction(new EventHandler<ActionEvent>() {
      @Override public void handle(ActionEvent actionEvent) {
        layout.setCenter(new Label("Dilbert"));       
    });In the above short sample code, if you wanted to change the scene rather than the a pane, then you would call stage.setScene rather than layout.setCenter.
    There is a complete executable example with multiple content panes and some styling here:
    http://stackoverflow.com/questions/13556637/how-to-have-menus-in-java-desktop-application

  • After login close the login window and open home page in new window

    Hi guys,
    I want to go to a new window for the "home page" without browser back button etc. after login validation.
    And also close the login window at the same time.
    Here is the code I used after the login validation.
    ExtendedRenderKitService erks =Service.getRenderKitService(FacesContext.getCurrentInstance(),ExtendedRenderKitService.class);
    StringBuilder script = new StringBuilder();
    script.append(" params = 'width='+screen.availWidth-10;\n" +
    " params += ', height='+screen.availHeight-50;\n" +
    " params += ', top=0, left=0'\n" +
    " params += ', fullscreen=yes';\n" +
    " params += ', scrollbars=1';\n" +
    " params += ', resizable=1';\n" +
    " params += ', status=1';\n" +
    "window.close();\n" +
    " newwin=window.open('home.jspx','xxxxxxxxx', params);\n" +
    " if (window.focus) {newwin.focus()}");
    erks.addScript(FacesContext.getCurrentInstance(), script.toString());
    This successfully opens a new window. I want to close the current login window at the same time.
    Please help me with this.
    Regards !
    Sameera

    on the 'Submit' onclick event add some JavaScript code:
    this.form.target = '_blank';

  • HT1941 Hi i have recently updated my version of iTunes in order to sync music from my macbook air to my new ipod shuffle. After a successful installation the application does not launch and I am unable to oepn iTunes of access my music! Someone please hel

    Hi,
    I have recently updated my iTunes to the latest version in order to sync music onto my new ipod shuffle. However after a successful installation the application does not launch or open? There are no error messages. The application is just unresponsive.
    I have already checked the compatibility with Safari, my operating system and checked my firewall is not blocking it - all is fine.
    Does anyone have any other resolutions?
    Many thanks

    Hi Carolyn,
    Thank you for your time and response. The trouble is I am unable to launch iTunes? I have restarted my macbook air a number of times to try and initiate the application but the issue persists and the application remains unresponsive. Will not launch?
    Thanks

  • I was directed to adobe to download CS4 on my new iMAC after hardware failure on PC.  The valid CS4 serial number for the PC is not recognized by Adobe, even though I downloaded all the software successfully.  They gave me a free 30 day trial.........Does

    I was directed to adobe to download CS4 on my new iMAC after hardware failure on PC.  The valid CS4 serial number for the PC is now not recognized by Adobe, even though I downloaded all the software successfully on the new iMac..  They gave me a free 30 day trial on the new iMAC.........Does this mean I have to spend a lot of money to update and activate the latest CS release on the new machine ??????

    Purple Lobster your Creative Suite 4 serial number is for Windows or Mac only.  If you were previously using it on Windows then it is likely you have a Windows license.  You can verify by checking your serial number at http://www.adobe.com/.  You can find more details at Find your serial number quickly - http://helpx.adobe.com/x-productkb/global/find-serial-number.html.
    If you wish to run Adobe Creative software on your new iMac then I would recommend a Creative Cloud complete or single application membership.  You can find more details at https://creative.adobe.com/plans.  There is also a 30 day trial available for the Creative Cloud if you wish to evaluate the newest versions of the Adobe Creative applications.

  • Login invalid on new MacBook after Migration Assistant

    Migration Assistant problem
    New computer: 15" MacBook Pro with Retina display (probably OS X Lion
    Old computer:  15"Macbook Pro running Mountain lion.
    My regular login password is invalid on the new computer after migration assistant - Not sure what to do.
    Any help is greatly appreciated.
    Thanks

    I managed to find a solution
    Here is the link:
    http://osxdaily.com/2010/08/10/forgot-mac-password-how-to-reset-mac-password/
    There are instructions to reset the mac password without a CD.  You set up a new admin account then you can reset the password to your original account.
    It solved the problem.

  • I have been using Lightroom 4.4 successfully for over 2 years.  Just tried to import some new photos after a vacation and the application crashes when I click "import" every time.  Tried restarting computer.  Version says it is up to date.

    I have been using Lightroom 4.4 successfully for over 2 years.  Just tried to import some new photos after a vacation and the application crashes when I click "import" every time.  Tried restarting computer.  Version says it is up to date.
    How do I get formal support for this from Adobe?

    Thanks for the response.  The application was crashing.  A Windows message was displayed showing "Lightroom.exe has stopped working", "Windows can check online for a solution the problem.". Etc.
    I just launched Lightroom to check the exact message for this reply - and the Import worked.  It had failed dozens of times before. 

  • Stopping Audio on a New Scene in AS3.

    Hello everyone,
    I was wondering how do I stop my audio when I enter a new scene?
    Any help will be very appreciated.
    Thank you.

    you should be using something like:
    var s:Sound=new MP3();
    var sc:SoundChannel=s.play();
    then when you want to stop this sound:
    sc.stop();

  • Menu tabs disappear completely after login and appears if only i press on item node at hire level

    I'm using a Menu Model to Create a Page Hierarchy in my adf application on Jdeveloper 11.1.2.3.0
    it is in three levels level 1 have 2 item nods (home - Help) displayed as buttons
                                level 2   contains 5 item nods about the managements displayed as tabs
                                level 3   is about reports displayed as list
    the point I have apply security in the application using Adf security wizard and i assign roles and users and grants
    all works fine but level 2 tabs disappear completely after login and appears if only i press on Home item node at run time
    I create 2 users (admin) has all roles  and can view all  tabs in level 2 of my navigation and another user (emp)  which can view one Tab page in level 2
    Point 1 --the item nod are rendered according the #{securityContext.regionViewable['oracle.view.pageDefs.RentManagPageDef']}     (EL ) expression language 
    and other item nod render property are set as the same but in the page name definition
    it works fine
    _ Point 2 in my page template I set #{menuInfo.rendered} for renderd property of the command navigation item
    it works fine
    - point 3 I add a  go link in my template to explicit perform log in log out from the app  and redirect the user to the required page
    Destination is
    #{securityContext.authenticated ? "/adfAuthentication?logout=true&end_url=/faces/wearhouse.jsf"  : "/adfAuthentication?success_url=/faces/company.jsf"}
    and its also works fine
    the problem is in the level 2 navigation tabs which is diaper after explicit log in the app directs the user to the correct page successfully
    But the tabs are not rendered till I press on home button on Level 1 navigation it appears and it appears  correctly cording the logged in user validation
    in another words i log in as user (admin) i get directed to the successful log in page  in the link go but  level 2 tabs are invisible or not rendered at all    I click on Home button in level1 navigation the tabs
    become rendered or viewable and i navigate normally
    I log out as admin the level 2 tabs becomes invisible again
    then I log in as (emp)  i get directed to the successful log in page and  level 2 tabs are still  invisible or not rendered
    I click on Home button in level1 navigation the only one tab the user emp authorized to it  gets rendered (appears)
    and its semi correct behavior because this is what I want him to see only
    my tries to find solution
    I tride to use
    #{securityContext.userInRole['division']}
    on the menu node item   I found same behavior level 2 tabs gets hidden till i click on home link at run time
    I tride to use #{securityContext.authenticated} to control item nods rending
    all tabs remains visible and i dont want that ain adition if user clicks on a tab of page he has no authority on it i recive server error
    I read 30.7 Creating a Login Page in the  Fusion Developer's Guide for Oracle Application Development Framework to finde about redirecting user
    and it is using the same as i did from adf tutorials
    I tried to make new navigation app on fast
    maybe i made incorrect change in any stage of my original app
    but I found same behavior
    I tried to set disabled property instead of rendered property the tabs are always rendered   but I got server error when I click on a tab which a user does not authorized
    So I doubt maybe problem in the El or the way I use to control rendering item node
    or there additional step to stop all  the tabs disappear after login
    I hope please some one Help or tell me what i have to read about in the developer guide  or interface developer guide or article on the web
    I'll be gratfule
    I know maybe it is small issue but help me please

    Hi,
    have a look at the sample that comes with this article: Oracle ADF: Security for Everyone It uses resource remissions to authorize panel tabs.
    One test to run is to print the outcome of the security evaluation (e.g. output text) to see what it returns.
    Frank

  • Black screen after login on Satellite L350-20Q (normal mode)

    My Satellite L350-20Q run Vista basic.
    After login that is normal I go to the turning arrow then to a permanent black screen when I start in normal mode.
    In safe mode I have a normal behaviour and I can work. Spybot report no malware present. But my Avast antivirus does not seems to work in safe mode.
    Do you have any idea of this problem ?
    A fellow has advised me to update my graphic drivers which is presently Intel Corporation 12/06/2008 version 7.15.10.I502 for Mobile Intel 4 series express chipset family. What is the URL and the filename to download the most recent driver ?
    Message was edited by: nigelle normal mode added in title.

    1) I have already done a roll back but without success
    2) total reinitialisation and updates is a long and tedious process I wish to avoid if possible.
    Downloading and installing a new driver is fast so I prefer to try this before even if the probability of improvement is low. Where can I find the driver for graphic ?
    3) I bought this lap top in June and Win7 was released in September or October.
    All manufacturers had promised a free update to Win7.
    But after the release of Win7 my laptop was not in the eligible list may be only because it ran on Vista basic and they were not Win7 basic and Toshiba did not want to pay for the upgrade...
    Not very honest !
    I dared not to buy a Win7 license because I think that Win on a laptop is a slightly modified version.

  • Windows XP hard crash reboot after login

    I've seen a few topics about this, but none of them with solid regression info yet so i'm starting this thread. I hope some of you out there can help out, but I fear the answer is that were all screwed.
    SUMMARY:
    Windows XP will hard crash (reboot) just after login after loading the UI and during the loading of network components. This then results in the system rebooting into a black screen with no standard windows debug. (which can be forced by F8) Hard shut down is required to restart boot process. This problem can also occur from a waking from sleep, and very rarely occurs at random. When its caused during normal operation its usually spawned on by pressing a button on the keyboard. It will occur randomly at startup, and will occur with Starup Disc set or Option Select. Rarely it will boot into windows XP on the first try, more often (over time) it will require 3-5 reboots to get into XP successfully. This problem isn't caused by the install of any software, instead it progressively gets worse over time. I have experienced this problem with BootCamp 1.3, 1.4 and 2.0 on my MacBook Pro 2.16, but I have never experienced it with my Mac Pro ever which has the same OS and bootcamp installed.
    I'm convinced it has something to do with the network drivers and how they are loading. I've noticed that the times it fails to boot that the WiFi and Local Area network icons aren't loaded in the system tray, and the times I have success getting into XP that they are already present when the UI is loading. This same behavior occurs on my Mac Pro and other PC clones, but they dont hard crash when this occurs. On them, you just have to wait for the network to be available.
    STEPS:
    0) MacBook Pro 2.16 17", Mac OS X 10.5.1, Bootcamp 2.0, Windows XP Pro SP2
    1) Power up
    2) Hold down Option (can set bootdrive as well)
    3) Select Windows
    4) Select a User (with password set)
    5) Enter password
    RESULTS:
    Hard crash reboot just after UI loads while network compoents begin to load into the system tray.
    WORKAROUND:
    Shoot dog
    REGRESSION:
    Never occures on Mac Pro
    Occures with Bootcamp 1.3, 1.4 and 2.0
    P.S. I'm writing this in Bootcamp

    UPDATE
    I've gone into msconfig and turned off everything and have been starting up just fine, so it seams one of these items is cuasing the problem. I see that some people say its the keyboard manager, and I wouldn't doubt it now. So i'm going to leave everything off for now, make sure its always booting and then slowing rool items back on. I'll keep this up to date.
    If you want to do this yourself, you can do it two ways.
    Built in:
    1) Click on the Start Button
    2) Select Run...
    3) type "msconfig" and hit OK
    4) Select the "Startup" tab
    5) Unselect everything you see there
    6) Close and reboot!
    3rd party (the way i prefer)
    1) Get Spybot (the new one is awesome)
    2) install Spybot
    3) Run Spybot
    4) Update, immulize and scan (optional, but you will be surprised)
    5) Select the "Mode" menu option
    6) Select "Advanced mode"
    7) Select 'tools" on the lower left hand side
    8) Select "System Startup"
    9) uncheck all options.
    10) close and reboot!
    Note: this appiaction is really great, and it will also install a device to watch for reg changes which is good for this sort of regression. Again, its not nessiary to install spybot, but i love it and have it on every PC i ever use and have never regretted it. IT WONT SLOW YOUR COMPUTER LIKE OTHER CRAPPY APPS. This is a very light and clean app.

  • 10.4.11 clients failing after login to 10.5.8 server

    I am going crazy trying to setup our xserver this year. I had it running last year without any problems. This year, the 10.4.11 clients keep losing connection to the server after login. After login, the Home folder is there, then gone. You can see it disappear. The log reads "cannot mount /network/Servers/mac.ourdomain.edu.au/volumes/t_home/teacher error 22 (Invalid Argument)"
    Leopard clients seem fine.
    I have tried everything - rebinding; reinstalling many times. I thought the path to home folders might be too long; so I made the shortname smaller to get under 89, but I've never had to do this before. Changeip returns no errors. DNS is fine - there are some errors to certain addresses "could not update - permission denied". However these machines are not losing connections. I tried a dummy set up on a different address but got no further. Can anyone post and tell me:
    1. AFP connect via : I usually use Standard to avoid Kerberos timeouts - is this the problem?
    2. Guest access: supposedly helps with Tiger clients - true?
    3. Total path to home folder - Tiger setting?
    4. Login to the server to set up sharing in Server admin using IP Address ok?
    I have never had these sorts of problems. Do I just need to wipe the pre 10.5 clients? They have been set to the same IP for years so I'm wondering what I should do there. Is it DNS? I can get more log files tomorrow.
    Btw, not just beginner - I have spent a fair bit of money and time on training and have had many successful set ups at school, but really struggling here. Any tips or brickbats please . . . thanks very much.

    Unless things have changed, Guest Access must be on the User share on the server.
    The workstation needs access to resources prior to a user actually logging in.
    We use Kerberos only for our 10.4.11 and 10.5.8 clients. We also use the DHCP and DNS service on the Mac servers.
    We set guest access allowed in the AFP section and in File Sharing / Protocol Options. That does not mean that you actually need to give the Guest account access, just that it must be on.

  • I have an ipod touch 2 and rebuilt my laptop.  Reinstalled ITUNES and can't find my applications on ITunes after login.  I tried to activate Itunes again but it didn't.  How can I get my applications to display on ITUNEs?

    I have an Ipod Touch 2 and rebuilt my laptop.  Reinstalled ITUNES and can't find my applications on ITunes after login.  I tried to activate Itunes again but it didn't.  How can I get my applications to display on ITUNEs?

    It sounds like you essentially have a new computer and unless you restored from a backup your iTunes library would be empty.  You can transfer your iTunes purchases from your iPod to the computer by:
    iTunes Store: Transferring purchases from your iPhone, iPad, or iPod to a computer
    SInce you changed syncing computers. after you move the stuff you need to restore the iPod to factory defaults and sync the stuff back to your iPod.  If you had the iPod backup file you could restore from backup.
    If you have non-iTunes pruchases you can copy them to your computer by using one of the third-party programs discussed in this previous discussion:
    Best iPod to PC

Maybe you are looking for

  • Give us your feedback on v1.2 of the ILM Assistant

    Please give us your feedback on v1.2 What would you like us to do next? Lilian

  • 720p vs 1080

    I have various qt's some in 720p some in 1080i , I have to edit them on one timeline and deliver to the broadcaster for transmission, would... a. is this possiable on one timeline (do i open a 1920 x 1080 timeline and then edit the 720 in that ?) wou

  • TCP/IP error 63

    Hello everyone, I have attached two vi's that communicate between my HMI and FP module using TCP/IP. Is there any reason why my connection would not re-establish after being broken e.g loss of power to the PC or even pulling the the network cable out

  • OID plug-in capabilities!!

    Hi OID team, As we can not replace or load our corporate users/passwords in to OID (which is required to use SSO in 9iAS), we decided to implement when_compare_replace plug-in procedure to authenticate a user depending on the cookie (which will be se

  • Quiz Preference Pass or Fail Settings

    I have a 5 slide Captivate Project. I have a next button set up on each slide for a total of 4 buttons. Each button is set to a value of 1. Add to Total and Track Score is checked for each button with report answer is left blank. I am using AICC with