Re: [Flashcoders] .onLoad works in AS1, breaks in Flash 7
Alain / Rahul, Thanks for your replies. I guess 6 was a lot more lenient when it came to case sensitivity than 7. (I should be aware of that, too, as I do a lot of PHP programming.) It's working now, so what remains is to see if internal links will work, etc. For a day here I was wondering just what the devil was going on. Regards - Miles At 12:05 AM 10/19/2005, Alain Rousseau wrote: Hi Miles, as Rahul stated, you should try to put the L of Load to lowercase load, also it would be best to put your url in a variable : var myUrl:String = "http://"+host+"feed_issuedates.php";; varGetDates.load(myUrl); it's cleaner and you can reuse myUrl variable anytime you want, instead of writing down the whole thing. as for local to network testing goes, Flash 7 is not as severe as Flash 8, but it is good to set your crossdomain.xml, it often blocks your code from linking to outside sources. Try changing the case of the 'L' and see where this gets you ... sometimes it's just a small syntax error that takes your project down ! good luck, Alain Rahul wrote: Hi Alain, It's not working in Flash 7 b'cos u r using upper case 'L' in Load method. Try using this "varGetDates.load( "http://"; + host + "feed_issuedates.php");" a lower case 'l' for Load and this should work in both the versions of Flash. Regards, Rahul Miles Thompson wrote: Alain, I've adapted the code somewhat, to the extent it closely mimics the examples whown in the docs. For example varGetDates = New LoadVars; is changed to var varGetDates:LoadVars = new LoadVars();, and I've added type declarations to the other variables declared in the very first frame. "success" is not declared anywhere, though now it has ":Boolean" added to it. I've also added the crossdomain.xml file, my thinking being that the data was not being returned because I was doing a debug test on my local machine, but the data and scripts are at www.allnovascotia.com. I'm finding this very puzzling, and of course had assumed it would be a simple "save as Flash 7, compile and we're done" scenario. Thanks for responding - Miles At 11:24 PM 10/18/2005, Alain Rousseau wrote: Have you verified that you compiled in Flash 7 using AS1 and not AS2 ? if not you might need to adapt your code a little to work with AS2 compiler. Miles Thompson wrote: This code works in AS1 (Flash 6) but "success" never occurs in Flash 7. What could I be doing wrong? function getIssueDates() { varGetDates = new LoadVars(); //varGetDates.cacheKiller = new Date().getTime(); varGetDates.Load( "http://"; + host + "feed_issuedates.php"); varGetDates.onLoad = function( success ) { if (success) { _root.issuedates = varGetDates.issuedates; } else { // provide today's date today = new Date(); issuedates = string( today.getFullYear() ) +"-"; issuedates = issuedates + string( today.getMonth() + 1) + "-"; issuedates = issuedates + string( today.getDate() ); } // if(success) etc., etc. } } Note: Host is set in the first frame through an inclusion: #include "settings.as". Host shows up in the degugger variables window as "www.allnovascotia.com/test/" What is passed to varGetDates.Load is "http://www.allnovascotia.com/test/feed_issuedates.php"; A trace( varGetDates.issuedates) inserted immediately before "if(success)" returns an empty string. Same statement, following the if(success) is never evaluated. No conversion was followed, the previous Flash MX version was opened using Flash MX 2004, and then simply Save As'd to a new location; when warned that the file would no longer be openable in Flash MX I clicked on OK. Have I missed something really basic? I'm compiling as ActionScript 1 in the Publish settings. A steer in the right direction will be greatly appreciated - Miles Thompson ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] .onLoad works in AS1, breaks in Flash 7
Hi Miles, as Rahul stated, you should try to put the L of Load to lowercase load, also it would be best to put your url in a variable : var myUrl:String = "http://"+host+"feed_issuedates.php";; varGetDates.load(myUrl); it's cleaner and you can reuse myUrl variable anytime you want, instead of writing down the whole thing. as for local to network testing goes, Flash 7 is not as severe as Flash 8, but it is good to set your crossdomain.xml, it often blocks your code from linking to outside sources. Try changing the case of the 'L' and see where this gets you ... sometimes it's just a small syntax error that takes your project down ! good luck, Alain Rahul wrote: Hi Alain, It's not working in Flash 7 b'cos u r using upper case 'L' in Load method. Try using this "varGetDates.load( "http://"; + host + "feed_issuedates.php");" a lower case 'l' for Load and this should work in both the versions of Flash. Regards, Rahul Miles Thompson wrote: Alain, I've adapted the code somewhat, to the extent it closely mimics the examples whown in the docs. For example varGetDates = New LoadVars; is changed to var varGetDates:LoadVars = new LoadVars();, and I've added type declarations to the other variables declared in the very first frame. "success" is not declared anywhere, though now it has ":Boolean" added to it. I've also added the crossdomain.xml file, my thinking being that the data was not being returned because I was doing a debug test on my local machine, but the data and scripts are at www.allnovascotia.com. I'm finding this very puzzling, and of course had assumed it would be a simple "save as Flash 7, compile and we're done" scenario. Thanks for responding - Miles At 11:24 PM 10/18/2005, Alain Rousseau wrote: Have you verified that you compiled in Flash 7 using AS1 and not AS2 ? if not you might need to adapt your code a little to work with AS2 compiler. Miles Thompson wrote: This code works in AS1 (Flash 6) but "success" never occurs in Flash 7. What could I be doing wrong? function getIssueDates() { varGetDates = new LoadVars(); //varGetDates.cacheKiller = new Date().getTime(); varGetDates.Load( "http://"; + host + "feed_issuedates.php"); varGetDates.onLoad = function( success ) { if (success) { _root.issuedates = varGetDates.issuedates; } else { // provide today's date today = new Date(); issuedates = string( today.getFullYear() ) +"-"; issuedates = issuedates + string( today.getMonth() + 1) + "-"; issuedates = issuedates + string( today.getDate() ); } // if(success) etc., etc. } } Note: Host is set in the first frame through an inclusion: #include "settings.as". Host shows up in the degugger variables window as "www.allnovascotia.com/test/" What is passed to varGetDates.Load is "http://www.allnovascotia.com/test/feed_issuedates.php"; A trace( varGetDates.issuedates) inserted immediately before "if(success)" returns an empty string. Same statement, following the if(success) is never evaluated. No conversion was followed, the previous Flash MX version was opened using Flash MX 2004, and then simply Save As'd to a new location; when warned that the file would no longer be openable in Flash MX I clicked on OK. Have I missed something really basic? I'm compiling as ActionScript 1 in the Publish settings. A steer in the right direction will be greatly appreciated - Miles Thompson ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] .onLoad works in AS1, breaks in Flash 7
Alain, I've adapted the code somewhat, to the extent it closely mimics the examples whown in the docs. For example varGetDates = New LoadVars; is changed to var varGetDates:LoadVars = new LoadVars();, and I've added type declarations to the other variables declared in the very first frame. "success" is not declared anywhere, though now it has ":Boolean" added to it. I've also added the crossdomain.xml file, my thinking being that the data was not being returned because I was doing a debug test on my local machine, but the data and scripts are at www.allnovascotia.com. I'm finding this very puzzling, and of course had assumed it would be a simple "save as Flash 7, compile and we're done" scenario. Thanks for responding - Miles At 11:24 PM 10/18/2005, Alain Rousseau wrote: Have you verified that you compiled in Flash 7 using AS1 and not AS2 ? if not you might need to adapt your code a little to work with AS2 compiler. Miles Thompson wrote: This code works in AS1 (Flash 6) but "success" never occurs in Flash 7. What could I be doing wrong? function getIssueDates() { varGetDates = new LoadVars(); //varGetDates.cacheKiller = new Date().getTime(); varGetDates.Load( "http://"; + host + "feed_issuedates.php"); varGetDates.onLoad = function( success ) { if (success) { _root.issuedates = varGetDates.issuedates; } else { // provide today's date today = new Date(); issuedates = string( today.getFullYear() ) +"-"; issuedates = issuedates + string( today.getMonth() + 1) + "-"; issuedates = issuedates + string( today.getDate() ); } // if(success) etc., etc. } } Note: Host is set in the first frame through an inclusion: #include "settings.as". Host shows up in the degugger variables window as "www.allnovascotia.com/test/" What is passed to varGetDates.Load is "http://www.allnovascotia.com/test/feed_issuedates.php"; A trace( varGetDates.issuedates) inserted immediately before "if(success)" returns an empty string. Same statement, following the if(success) is never evaluated. No conversion was followed, the previous Flash MX version was opened using Flash MX 2004, and then simply Save As'd to a new location; when warned that the file would no longer be openable in Flash MX I clicked on OK. Have I missed something really basic? I'm compiling as ActionScript 1 in the Publish settings. A steer in the right direction will be greatly appreciated - Miles Thompson ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] .onLoad works in AS1, breaks in Flash 7
Hi Alain, It's not working in Flash 7 b'cos u r using upper case 'L' in Load method. Try using this "varGetDates.load( "http://"; + host + "feed_issuedates.php");" a lower case 'l' for Load and this should work in both the versions of Flash. Regards, Rahul - Original Message - From: "Alain Rousseau" <[EMAIL PROTECTED]> To: "Flashcoders mailing list" Sent: Wednesday, October 19, 2005 10:24 AM Subject: Re: [Flashcoders] .onLoad works in AS1, breaks in Flash 7 > Have you verified that you compiled in Flash 7 using AS1 and not AS2 ? > if not you might need to adapt your code a little to work with AS2 compiler. > > Miles Thompson wrote: > > > This code works in AS1 (Flash 6) but "success" never occurs in Flash 7. > > What could I be doing wrong? > > > > function getIssueDates() > > { > > varGetDates = new LoadVars(); > > //varGetDates.cacheKiller = new Date().getTime(); > > varGetDates.Load( "http://"; + host + "feed_issuedates.php"); > > varGetDates.onLoad = function( success ) > > { > > if (success) > > { > > _root.issuedates = varGetDates.issuedates; > > } else > > { > > // provide today's date > > today = new Date(); > > issuedates = string( today.getFullYear() ) +"-"; > > issuedates = issuedates + string( today.getMonth() + 1) + > > "-"; > > issuedates = issuedates + string( today.getDate() ); > > } // if(success) > > etc., etc. > > } > > } > > > > Note: Host is set in the first frame through an inclusion: #include > > "settings.as". Host shows up in the degugger variables window as > > "www.allnovascotia.com/test/" What is passed to varGetDates.Load is > > "http://www.allnovascotia.com/test/feed_issuedates.php"; > > > > A trace( varGetDates.issuedates) inserted immediately before > > "if(success)" returns an empty string. Same statement, following the > > if(success) is never evaluated. > > > > No conversion was followed, the previous Flash MX version was opened > > using Flash MX 2004, and then simply Save As'd to a new location; when > > warned that the file would no longer be openable in Flash MX I clicked > > on OK. > > > > Have I missed something really basic? > > > > I'm compiling as ActionScript 1 in the Publish settings. > > > > A steer in the right direction will be greatly appreciated - Miles > > Thompson > > > > > > ___ > > Flashcoders mailing list > > Flashcoders@chattyfig.figleaf.com > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > > > > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] .onLoad works in AS1, breaks in Flash 7
Have you verified that you compiled in Flash 7 using AS1 and not AS2 ? if not you might need to adapt your code a little to work with AS2 compiler. Miles Thompson wrote: This code works in AS1 (Flash 6) but "success" never occurs in Flash 7. What could I be doing wrong? function getIssueDates() { varGetDates = new LoadVars(); //varGetDates.cacheKiller = new Date().getTime(); varGetDates.Load( "http://"; + host + "feed_issuedates.php"); varGetDates.onLoad = function( success ) { if (success) { _root.issuedates = varGetDates.issuedates; } else { // provide today's date today = new Date(); issuedates = string( today.getFullYear() ) +"-"; issuedates = issuedates + string( today.getMonth() + 1) + "-"; issuedates = issuedates + string( today.getDate() ); } // if(success) etc., etc. } } Note: Host is set in the first frame through an inclusion: #include "settings.as". Host shows up in the degugger variables window as "www.allnovascotia.com/test/" What is passed to varGetDates.Load is "http://www.allnovascotia.com/test/feed_issuedates.php"; A trace( varGetDates.issuedates) inserted immediately before "if(success)" returns an empty string. Same statement, following the if(success) is never evaluated. No conversion was followed, the previous Flash MX version was opened using Flash MX 2004, and then simply Save As'd to a new location; when warned that the file would no longer be openable in Flash MX I clicked on OK. Have I missed something really basic? I'm compiling as ActionScript 1 in the Publish settings. A steer in the right direction will be greatly appreciated - Miles Thompson ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders