[Flashcoders] Using Onload to set global variables for GetURL's

2007-05-30 Thread Bennington Purcell

Okay, i am trying something different.   I have one movie that loads other
ones, i want to run this connection testing script in the main movie.  So i
am trying this code

loadMovie("g/home.swf", _root.contentMC);  // a movie that loads ASAP

contentMC.onLoad = myFunction; // run my FUNCTION when the content loads?

function myFunction() {
  var result_lv:LoadVars = new LoadVars();
  result_lv.onLoad = function(success:Boolean) {
 if (success) {
 trace("we got connection");
 _global.url = "http://domain.com/documents";; // set Variable
 } else {
 trace("no connection");
 _global.url = "Documents/";  // set Variable
 }
  };

  var send_lv:LoadVars = new LoadVars();
  send_lv.sendAndLoad(" http://www.google.com";, result_lv, "POST");

}
==

Hopeing that would set the variable _global.url so i could use that to write
getURL statements in the sub pages?

like
on(release){
getURL(_global.url + "pdf_to_Load.pdf") /*  if online i want it to go to
domain.com/documents/pdf_to_Load.pdf otherwise just the local copy  */
}

Am i just totally off base,   is there a way i can debug and see my global
variables?  cause this way they aren't showing up ever!
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] Conenction Sensing multiple button AS change

2007-05-22 Thread Bennington Purcell

I have a flash projector i use to download files,  with help i figured out
how to get the system too see if it was online and then download the
appropraite file,   the actionscript is

var result_lv:LoadVars = new LoadVars();
result_lv.onLoad = function(success:Boolean) {
   if (success) {
   trace("we got connection");
   getURL("http://www.domain.com/pdf.pdf";);
   } else {
   trace("no connection");
   getURL("downloads/pdf.pdf");
   }
};
var send_lv:LoadVars = new LoadVars();

my_btn.onRelease = function(){
send_lv.sendAndLoad("http://www.google.com";, result_lv, "POST");
}

I am now trying to figure out how to make this script happen when the movie
loads (it is inside another movie) and to work on MANY links,
I want to just sent the download URL with this sript and then pull it with
each button?

I can't make it work right,  any ideas?

Thanks
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] Projector File download with GetURL

2007-05-16 Thread Bennington Purcell

Hey everyone!

i am working on a projector file,  i would like to do some actionscripting
on download links that checks if it is a MAC or PC, and if there is internet
or not.  If it is a mac i want to always download the file from the internet
(some pdf files) if it is a PC i want to download them if there is an
internet connection, if no connection i want to grab the one on the cd?

I can't figure it out at all, but then i am a Flash Newbie...   Any help
would be appreciated, or any ideas...  (i have spent the last 2 days looking
for a solution online, i didn't want to bother you first)

Thanks everyone
Bennington V Purcell


--
=
Bennington V. Purcell

-- Integrated Technology Solutions ---
[EMAIL PROTECTED]
802.558.2075
=
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com