View Full Version : ASP variables to a Projector/swf
shotsy247
12-02-2005, 07:56 PM
I have read several posts on this subject but am still unclear. Is it possible to get variables from an asp into a projector or swf, not running in a browser?
I have used the following code in my Flash movie:
myVars = new LoadVars();
myVars.load("http://webConnect.asp");
myVars.onLoad = function(success){
if(success){
feedback.text = myVars.webConnect;
}else{
feedback.text = "Error connecting.";
}
}
The asp page has a variable of webConnect = true
When I run this through a browser it works and returns true. When I run it as a standalone swf it comes up as error connecting.
Thanks.
_t
I dont think a projector file can call files like that, it can call other exe's...there are an assortment of freeware tools available that will give you that functionality.
CyanBlue
12-02-2005, 10:46 PM
Um... Any reason why you are saying no, Cota???
I always thought that you should be able to make live HTTP call from the projector...
Thats what I was reading...I wasnt sure myself, I so I went on alittle google search. Everything I came across said you couldnt do it like you would a regular swf...To me it sounds alittle strange, but thats what I came across is like 20 different sites..
CyanBlue
12-02-2005, 10:54 PM
Um... There must be something I am missing...
Create a projector with the attached file and run that EXE file to see if you get 'true' there or not...
I am calling the PHP script in my domain which says echo("&webConnect=true&");
I will have to test it a little later...not on my machine...like I said, that just what I read...I have a disclaimer....:D
CyanBlue
12-02-2005, 11:06 PM
I am more confused because I am not sure if I am understanding the question correctly or not... Know what I mean???
Maybe you could post those links if you still have them open so that I can see??? ;)
Here is one, I cant find the others...
http://www.flashgeek.com/tutorials/07_launchapp_01.asp
Maybe I'm the one that missed something..
CyanBlue
12-02-2005, 11:19 PM
I think that page is talking about executing files from the projector like opening a PDF file or Excel file or something, but the question of this thread is to see if you can use LoadVars().load() from the projector, I think...
I assumed the two were directly related. When the SWF was run outisde of a broswer, loadvars stopped working, so I assumed it was an execution issue, which lead me there..
CyanBlue
12-02-2005, 11:25 PM
When the SWF was run outisde of a broswer, loadvars stopped working
That's very interesting... The only reason I can think of why it did not work is when you did not provided the full URL... Otherwise, it should work... Hm...
That was why I investigated that route...
shotsy247
12-03-2005, 12:50 AM
Wow! A lot of action on this thread since I left work.
Thanks for the responses guys.
I think that page is talking about executing files from the projector like opening a PDF file or Excel file or something, but the question of this thread is to see if you can use LoadVars().load() from the projector, I think...
Yes CyanBlue, that is what I'm trying to figure out. Although, all of my tests so far have come up with errors (Like Cota suggests in his findings). When I run the swf from within a browser it returns the value I set in the asp page as true. When I run the same Flash movie as an exe it returns that it wasn't able to connect to the page.
I haven't opened and tried your example yet. I hope it shows me the way.
_t
shotsy247
12-03-2005, 12:58 AM
OK CyanBlue, your file worked.
I don't get it. It's identical to the one I was using except for the address, but at work mine wouldn't work. I wonder if a firewall could have been silently blocking it?
_t
CyanBlue
12-03-2005, 02:45 AM
Well... To be honest with you I am not still understanding if I am getting your question right or not... Must be my brain... :(
Just as a record... I never had problem making/receiving HTTP calls from the projector on PC as long as I provide the full URL...
One way would be to get the EXE from the work to your home and run it to see if it works outside of the company firewall... I am sorta doubting it though...
At any rate, if it does not work, you might want to create a sample movie like I did and post it so that we can know more about your problem... ;)
shotsy247
12-05-2005, 01:43 PM
Ok back at work now. While I can't test the exe I created here at home because the address I'm hitting is an internal address, I did test your movie and it did not connect. So I am concluding that it is the company firewall blocking at least the http return.
I guess I'll have to use an HTML window instead of an exe, since I will have no idea about the firewall settings where this will be run.
Thanks for your help.
_t
ovydiu
12-05-2005, 01:56 PM
there might be another way but it's not something you'd like..
you can call the asp page from a swf inside a web browser and send info from this flash to the flash projector using the LocalConnection.. the problem is you need two swfs running at the same time
shotsy247
12-05-2005, 02:09 PM
Thanks for the thought, but I actually don't mind running this movie directly from a browser window, so I'll just skip the exe.
Interesting work around though.
_t
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.