quincewyss Posted October 18, 2007 Share Posted October 18, 2007 I'm trying to make a link from flash work. It may sound weird because yeah GetURL..., but I have to follow the rule allowNetworking="internal" on the emmbed tag. Inturn I can only use sendAndLoad from flash. So what I want to do is have a link in flash call a php file using sendAndLoad. I have that all working now here's the hard part. I need the php file to then take the url var I sent and go to that url. I have tried header(location...), meta refresh, javascripts and auto submit form none of these work from the flash peice, but all work when I go straight to the php file. The problem occurs because all header info and html info have already been loaded. Does anyone know of a different way to make the php file go to a new URL? Thanks!!! Quince Wyss Quote Link to comment https://forums.phpfreaks.com/topic/73816-flash-to-php-forward-to-new-url/ Share on other sites More sharing options...
~n[EO]n~ Posted October 18, 2007 Share Posted October 18, 2007 let us see the code man !!! Quote Link to comment https://forums.phpfreaks.com/topic/73816-flash-to-php-forward-to-new-url/#findComment-372381 Share on other sites More sharing options...
quincewyss Posted October 18, 2007 Author Share Posted October 18, 2007 flash code: function createTheMenu(MM){ var result_createMyMenu:LoadVars = new LoadVars() result_createMyMenu.onLoad = function(){ error_txt.text = "hello!!"; } var createMyMenu:LoadVars = new LoadVars() createMyMenu.mm = MM; createMyMenu.sendAndLoad("http://peakstudios.com/keith/myspace/f_test.php", result_createMyMenu, "POST") } the error text comes back with hello!! showing that flash has made comunication with the php file. The PHP: <?php header("location: http://peakstudios.com"); ?> once I get the new page opening I will bring in the MM var thru POST to send the user to the specific URL. Thanks! Quince Quote Link to comment https://forums.phpfreaks.com/topic/73816-flash-to-php-forward-to-new-url/#findComment-372387 Share on other sites More sharing options...
koolaid Posted October 18, 2007 Share Posted October 18, 2007 flash code: function createTheMenu(MM){ var result_createMyMenu:LoadVars = new LoadVars() result_createMyMenu.onLoad = function(){ error_txt.text = "hello!!"; } var createMyMenu:LoadVars = new LoadVars() createMyMenu.mm = MM; createMyMenu.sendAndLoad("http://peakstudios.com/keith/myspace/f_test.php", result_createMyMenu, "POST") } the error text comes back with hello!! showing that flash has made comunication with the php file. The PHP: <?php header("location: http://peakstudios.com"); ?> once I get the new page opening I will bring in the MM var thru POST to send the user to the specific URL. Thanks! Quince I think your Action Script is where the problem lies var error_txt.text:TextField; error_txt.text .text = "Please Wait... Loading..." // declare and instantiate a LoadVars object var result_createMyMenu:LoadVars = new LoadVars(); // point our LoadVars 'onLoad' handler to our function // Note that this should be done before trying to load any data. result_createMyMenu.onLoad = function(successful) { if(successful) { var createMyMenu:LoadVars = new LoadVars() createMyMenu.mm = MM; } else { error_txt.text .text = "error loading data" } } createMyMenu.sendAndLoad("http://peakstudios.com/keith/myspace/f_test.php", result_createMyMenu, "POST") Quote Link to comment https://forums.phpfreaks.com/topic/73816-flash-to-php-forward-to-new-url/#findComment-372625 Share on other sites More sharing options...
quincewyss Posted October 18, 2007 Author Share Posted October 18, 2007 Actually the flash was working fine. I tested your code just to make sure but it doesn't work(flash sends then loads your code was backwards). The problem is that the page has already been written and now flash is asking php to go to a new page. Is there a way to make php go to a new page when asked? Quote Link to comment https://forums.phpfreaks.com/topic/73816-flash-to-php-forward-to-new-url/#findComment-372676 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.