Hello folks.
I really need your help here. I once bought a small favor from a flash coder from activeden.net a few years ago.
I would like to have modified it slightly. I do not know so much about flash and hope you can help me here. I wanted 2 things, which I got. I wanted a small flash application where I had the opportunity to log in and out http://shahirart.com/ check out the link. Login and out with the password "flash". It works as it should when you login, the green ball with text "You are connected" and vice versa when you log off the ball is red and the text "You are disconnected." This app would be on a separate page. When I was logged in, another app with a similar green or red ball and with the text "admin is online" or "admin is offline" would be on the main website http://shahirart.com/app.html . This should then just indicate that visitors at home could see that the admin (me) was "physically" present on the site, ready for i.g a chat. The app on the site is therefore just a little graphic and a text which will be based on something genareret AS.
I want instead of bullet and text (admin is online / offline) is displayed when I log in, it must be a picture. Actually 2, both images have the same dimensions, but one show that I am not online and the other shows that I am. Hope it made sense. Here is the code of the app which is the part that shows the admin is online or offline:
Code:import caurina.transitions.Tweener; var intervalo = setInterval(stat, 1000); function stat():Void { var lv:LoadVars = new LoadVars(); lv.load("status.txt?" + random(9999)); //lv.load("http://localhost/hamid/status.txt?" + random(9999)); lv.onLoad = function(succes) { if(succes) { if (this.status == "online") { Tweener.addTween(status_mc.circle, {_color:"0x009900"}); status_text.text = "Admin is connected"; } else { Tweener.addTween(status_mc.circle, {_color:"0xFF0000"}); status_text.text = "Admin is disconnected"; } } else trace("Error loading data"); } }
And here is the code of the app on the independent side where I log in or out.:
I really hope you can help me out here. I know that the problem is not greater than I make it. but I just can not figure it out.Code:import caurina.transitions.Tweener; status_text.text = "You are disconnected"; login_mc.login.onRelease = function():Void { trace(login_mc.txtPass.text); var lv:LoadVars = new LoadVars(); var rv:LoadVars = new LoadVars(); lv.passw = login_mc.txtPass.text; lv.sendAndLoad("login.php", rv, "POST"); //lv.sendAndLoad("http://localhost/hamid/login.php", rv, "POST"); rv.onLoad = function():Void { if(this.ok == "OK") { trace("login") Tweener.addTween(status_mc.circle, {_color:"0x009900"}); login_mc.txtPass.text = ""; status_text.text = "You are connected"; } else { trace("no login"); Tweener.addTween(status_mc.circle, {_color:"0xFF0000"}); } } } logout_mc.login.onRelease = function():Void { var lv:LoadVars = new LoadVars(); var rv:LoadVars = new LoadVars(); lv.passw = logout_mc.txtPass.text; lv.sendAndLoad("logout.php", rv, "POST"); //lv.sendAndLoad("http://localhost/hamid/logout.php", rv, "POST"); rv.onLoad = function():Void { if(this.ok == "OK") { //trace("logout") Tweener.addTween(status_mc.circle, {_color:"0xFF0000"}); logout_mc.txtPass.text = ""; status_text.text = "You are disconnected"; } else { //trace("not logout"); Tweener.addTween(status_mc.circle, {_color:"0x009900"}); } } }
Sincerely HRB


Reply With Quote

Bookmarks