new scene after the success of connecting AS3

Hi guys,.

I am really new to actionscript, so I have trouble understanding the code. I tried a lot of ways to go to a new scene after the successful login, but unfortunately not. I followed one of the tutorials on the part of connection... It works and I'm happy wif it... but right now, it only displays the success message. Instead, I want to go to a new scene, but don't know how. I'll post the code below. Hope you can help ... I have a date for this project. Thank you!

[actionscript]

the package of actions {}

import flash.display.MovieClip;

import flash.events. *;

flash.net import. *;

import flash.text. *;

main/public class extends MovieClip {}

public int main (): void {}

submit_button.buttonMode = true;

submit_button.addEventListener (MouseEvent.MOUSE_DOWN, checkLogin);

username. Text = "";

Password.Text = "";

}

public void 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 = pouvez;

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']; flash variables

$password = $_POST ["password"];

If ($_POST ['systemCall'] == 'checkLogin') {}

$sql = "SELECT * OF 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 scene following 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 is the first line is check if the welcome Word is at the beginning of all that is in the textfield (starting at index 0).  If so, then she issues a command to switch to a different frame/scene

Tags: Adobe Animate

Similar Questions

  • How to push a new page after the current pop page

    Hi all

    Is it possible for me to push a new page after the current page to burst?

    For example, main.qml I push page1.qml push page2.qml and pop page1.qml? (so the left in the stack are main.qml-> page2.qml)

    Can any ideas on how I do this?

    Thanks in advance.

    Of course! :-)

    You can use the NavigationPane remove() function...

    http://developer.BlackBerry.com/native/reference/Cascades/bb__cascades__navigationpane.html#function...

  • Where is CS Web Premium 5.5 for re - download, then install on the new computer, after the death of the former

    Where is CS Web Premium 5.5 for re - download, you need to install on the new computer, after the death of the former is not under my orders help

    Direct download links for Adobe software

    Mylenium

  • I can't create new events after the update to thunderbird SOLVED 38.3.0: timetable has been set to read-only

    Thunderbird running on the latest Mac OS. After the update to thunderbird at 38.3.0, I can create is more new events on my calendar (4.0.3 Lightning). I can see the "New event" selection when I click right on the screen of the calendar - but is greyed out and unselectable. Any help will be appreciated.

    Make sure that your calendar is not unalterable.
    Right click on the calendar in the left pane - properties

  • Satellite L40 - 14 H - do not start after the successful BIOS update

    Hello

    I have Satellite L40 - 14 H which was working fine until I thought to an update of the BIOS will not hurt. Seems I was wrong.

    I downloaded the update to the BIOS, it unzipped in a folder and started the action.

    After a few seconds was asked to wait, and then after few more firm.

    After the reboot, I pressed F2 to enter the BIOS and check that it is version everything was fine, version 2.0 so was I left once the parameters.

    After that, nothing happened.

    I almost tried everything without success. Removed the power and battery power, put their back, but still no start. Just the light of the HARD drive lights up for a few seconds and the cd turns a bit, but after that nothing happens at all and completely the screen is black.

    I don't know anything else to try.

    Please let me know what that can do to restore its functionality without taking it to the service, I can't do it.
    I think that may not be cause of failure of the BIOS update I have seen it is the version and was right.
    Is it possible to reset the BIOS? I need to disassemble the laptop to do this?
    Let me know what to do, I have good experience in such things, but I can't understand this.

    Thanks in advance for any response.

    Kind regards
    Stefan

    Hello

    I agree with Akuma. It really isn't that you can do about it. BIOS problems are complex and cannot be set by the owner of the laptop. Believe me you need professional help with this.
    Contact the closest Toshiba ASP and explain the situation.

  • X 1 carbon 2014 windows 7 hangs after the main power connection

    Nice day

    After the Polish Lenovo call center refuses to help me ask you to help. For about a week now, my X 1 carbon 2014 hangs after connection to the power supply. It's so irritating. I think, I only installed the updates regular windows 7 and the update of the BIOS via the lenovo update tool.

    The Polish Lenovo Support Center came with the excellent range of system solution. I really hope that you would be able to help more effectively at the same time.

    Thank you!

    Pawel


  • HP elitebook 2540p does not start after the successful bios update

    Hello people,

    I need your help.

    my hp elitebook 2540p with 2.5 "hhd does not start after a successful bios f.03 to f.24 upgrade done through windows 7.

    When I turn it on the blue light of wifi and power is on but nothing happen.

    I tried to remove the chip from the bios, cmos, hdd, ram, wifi battery... all, but nothing doesn't happen.

    I also tried to start it with the victory + b procedure and win + procedure four arrows so without USB key the caps lock flashing indefinitely but nothing happens, only the fan works quickly with a blue light

    with the USB the system restarts itself every two seconds and I have to remove the USB key.

    I do not know how...

    Thanks for any help.

    Luigi

    all very well now. I used the f.20 rom based on the internet and everything works again.

  • After the remote access connection, network printers disconnected

    I hope someone can help me here.

    In Windows Vista, whenever I would give the remote access connection to my PC at home, my default printer (which was be a shared printer on the network out of my server) will prepare its default value.  It was boring but easily fixible.

    I've since upgraded to Windows 7 Ultimate and I'm having a related problem.  Now every time I connect remotely to my home PC, my default printer (same network shared printer - HP LJ 4000) disconnects, and it only comes back online after a reboot.

    It is a point of pain is huge for me because I usually 20 + / applications windows running at a given time and a restart takes 30 minutes out of my day to get back to where I was.

    Any help would be appreciated. Jeff Balcerzak

    http://h30434.www3.HP.com/T5/printer-all-in-one-software-and/Windows-7-C7200-C7280-offline/m-p/167672

    http://social.technet.Microsoft.com/forums/en/w7itpronetworking/thread/0cfa31d7-B44B-4241-aa31-d0ae9f0a2112

    http://h10025.www1.HP.com/ewfrf/wc/document?DocName=c00843712&tmp_track_link=ot_faqs/top_issues/en_US/c00843712/loc:8 & lc = en & dlc = en & cc = us & product = 1153481 & lang = en

  • Unknow new device after the bios update and to install win 7 pro to the T400

    Hi all!

    My laptop: T400 2767-2JU. After the most recent update of the bios version (3.09) and own to install all the drivers in the Lenovo Site, I found an unknown device: Simple PCI communications controller. I don't think it's Thinkpad Modem, because, before updating the bios, the system does not have it.

    Please see my picture of capture: http://i92.photobucket.com/albums/l39/hoangnhat1613/T400-UnKnowDevice.jpg

    Someone help

    PS: Sorry for my English . Where to post the link to the image? All the drivers are installed

    I've seen it suggested that this (lists of mine such as serial Port PCI) device is Intel AMT / series on local network service.  Not useful for users and some utilities normally hides.

    Hardware ID Ven_8086 & DEV2A47

    http://forums.Lenovo.com/T5/T400-T500-and-newer-T-series/T500-Intel-driver-missing/TD-p/102526;jsess...

  • Impossible to reinstall my CS6 on the new PC after the death of the old PC

    I bought CS6 in 2012 (and here he is registered on Adobe.com) and installed on a laptop computer and a desktop computer.  Both are dead, and now I can not install it on a new desktop computer.  When I plug the drive there is no function to AutoPlay or not found exe file and a friend said that it is because I had it already installed on several computers and Adobe won't let me reinstall it again.

    I am retired and fixed income and can't afford to buy a new program or a monthly subscription for CC.

    The support page says that I can't get help from phone to do this.

    I would REALLY have CS6 again.

    Is there some kind a verified buyer can reinstall their own disk after the death of their older computers that he had installed everything?

    Your friend is misinformed. CS6 license is perpetual meaning it will last forever, if you have the hardware and the operating system required to run it.

    You can reinstall CS6 as often as you want on as many computers as you want. However, you can activate the software to be used on up to two computers at the same time, and you can use it on one computer at a time.

    Download applications download Adobe Creative Suite 6

    Install and enter your serial number.

  • New edition after the presentation product

    I just did a major overhaul of my products (files update, new photos, update the descriptions).  I know I should be more careful before submitting, but sometimes, I noticed some kind of error after I do, like leaving something out of description or something else that is not quite correct.

    Because it takes a few days to get our cases approved, would it be possible for us to go back and modify a product has already been submitted until then?

    Otherwise, I'm going to live and just change it after approval

    Hello

    If you have made a mistake when making a change or submitting a product the best thing to do is to email [email protected] and ask them to deny your request if you can make the necessary changes and then submit again. Sometimes if it's just a change small text size you and it is still in the review queue, you can simply email [email protected] and we can make the changes for you as part of the review process so that there is no time to release your new or updated product up-to-date.

    Hope that helps.

    Jonathan

  • Why does he move not CS4 (disks or download) on the new Windows 7 or Windows 8? I have unsuccessfully faced with tent to install my version of CS4 on a new computer, after the failure of our old one...

    I have suffered in vain trying to install my version of CS4 on a new computer after our old failed... always installs modules and peripheral software but fails to install PhotoShop, Illustrator, InDesign,... in short: something useful.

    Hello
    It's very strange. You see an error message? The installation fails right or what's happening? Can you be more specific please then I will try to help you with this one?

    Thank you
    Martin

  • VMS, powering down after the loss of connectivity data store

    My apologies for the newbie question.

    I have 2 ESXi4 hosts connected to a SAN, iSCSI via a switch.  I have server vSphere and HA but not DRS.  The switch has rebooted unexpectedly, that caused a rupture between the hosts and the storage where the virtual machines.  I expected the VMs system crashing, but it seems that they will switch off in an orderly fashion.

    After the reboot of the switch, the virtual machines automatically power (as has been fixed in my vSphere client)

    So was power off start function / stop into my vSphere client settings?  I don't see anything in the newspapers about HA and I didn't think it was a function of HA.

    Check the properties of VMware HA (in cluster settings).

    You will see that the response of isolation is set to shutdown the virtual machine.

    Isolation is when a host to see that he can not ping person.

    If you restart the switch that all guests get in isolation mode.

    You can change the timeout with HA advanced settings:

    http://KB.VMware.com/kb/1006421

    André

  • How to open a new tab after the current browsing session.

    I used to use the new King of the tab, and when I opened a new tab, it would still open the new tab the very right of my session, the gap and not somewhere randomly in the middle. However, I wanted my restored windows to open where I had closed my session. I've since changed to use the new tab more instead and it worked the same way before, but since I've updated for firefox 26, he seems to have reset this option (and others), it opens in the middle of the session now instead of the end.

    I don't know what you mean by the middle of the session.

    Do you mean in the middle of the bar tabs in the current window? There is a setting to make it open a link in a new tab adjacent to the page where you clicked on the link, or always at the end of the tab bar. If this is what you mean, here's how you can activate:

    (1) in a new tab, type or paste Subject: config in the address bar and press ENTER. Click on the button promising to be careful.

    (2) in the search above the list box, type or paste the tabs and make a pause so that the list is filtered

    (3) double-click the preference browser.tabs.insertRelatedAfterCurrent from true to false.

    But I'm not sure that's what you hear... also, extensions can replace Firefox built-in behaviors with their own settings tab.

  • After the success of the download, a software, but no icon appears on the desktop

    I was the successful download software "Pinyin Sougo" on my computer, but no icon displayed on the desktop.  Please help solve this problem.

    Thank you very much!

    The program may not have been built to automatically add a desktop icon.  To find it, try to open the start menu and in the search box, type "Pinyin".

Maybe you are looking for