gwolff2005 Posted April 29, 2009 Share Posted April 29, 2009 Hi guys, I have a swf movie done in Flash8., called testgreeting.swf. The actionscript code of this file is Actionscript greeting.text = "Dear " + username + ", nice to have you here!"; IN my php file I wrote PHP Code <script type="text/javascript"> var so = new SWFObject("testgreeting.swf", "menu", "200", "500", "9", "#FFFFFF"); so.addVariable("username", "<?php echo $_SESSION[MM_firstname] ?>"); so.write("flashcontent"); </script> I then inserted the flashviewer. The movie runs but the output is always "Dear undefined, nice to have you here". The Explorer bar left bottom shows an error saying "swf object is not defined." What is worng?? Thanks so much in advance! Link to comment https://forums.phpfreaks.com/topic/156081-solved-showing-variable-in-a-swf-object/ Share on other sites More sharing options...
Potatis Posted April 29, 2009 Share Posted April 29, 2009 I have never used flash like this so this is just a guess. Is the $_SESSION['MM_firstname'] defined after someone logged in? What happens if you hardcode the name? Does that work, like <?php echo "Bart"; ?> which would be defined. Link to comment https://forums.phpfreaks.com/topic/156081-solved-showing-variable-in-a-swf-object/#findComment-821647 Share on other sites More sharing options...
gwolff2005 Posted April 29, 2009 Author Share Posted April 29, 2009 Hi potatis, yeah that works. He takes the variable and when I echo it in php it works.. but just does not display it in the flash file.... Link to comment https://forums.phpfreaks.com/topic/156081-solved-showing-variable-in-a-swf-object/#findComment-821651 Share on other sites More sharing options...
Potatis Posted April 29, 2009 Share Posted April 29, 2009 You got this working then? Link to comment https://forums.phpfreaks.com/topic/156081-solved-showing-variable-in-a-swf-object/#findComment-821675 Share on other sites More sharing options...
gwolff2005 Posted April 29, 2009 Author Share Posted April 29, 2009 yeah I forgot to load up the swfobject.js file.... Thanks!!! Link to comment https://forums.phpfreaks.com/topic/156081-solved-showing-variable-in-a-swf-object/#findComment-821676 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.