Current location: Hot Scripts Forums » Programming Languages » PHP » PHP and Flashvars

PHP and Flashvars

Reply
  #1  
Old 11-05-09, 03:03 AM
harshadaj harshadaj is offline
New Member
 
Join Date: Nov 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
PHP and Flashvars

Hello,
I need to pass a PHP variable valye($username) as flashvars to my swf. I have already referred to an earlier post in the forum and coded accordingly. But I have problems:-
My TestFlashVars.php file is:-
PHP Code:
<?php
$username
="Harshada";
print 
"
<html>
<head>
<title>Test Flashvars</title>
</head>
<body scroll='no'>
<table width='100%' height='100%' cellspacing='0' cellpadding='0'><tr><td valign='top'>

<h1>Simplest FlashVarTest Wrapper</h1>

    <object id='mySwf' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab' height='100%' width='100%'>
        <param name='src' value='UseFlashVars.swf'/>
        <param name='flashVars' value=\"$username\"/>
        <embed name='mySwf' src='UseFlashVars.swf' pluginspage='http://www.adobe.com/go/getflashplayer' height='100%' width='100%' FlashVars=\"$username\"/>
    </object>

</td></tr></table>
</body>
</html>"
?>
This file gets loaded but I am not able to get the value in my swf.. My swf code is:-
Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="initVars()">
	<mx:Text x="45" y="52" text="Text" width="208" height="39" id="txt1"/>
	<mx:Script>
		<![CDATA[
			[Bindable]
    		public var userName:String;
    		
			private function initVars():void {
        	userName = Application.application.parameters.username;
        	txt1.text = userName;
		    }
		]]>
	</mx:Script>
	
</mx:Application>
What am I missing?

Last edited by Nico; 11-07-09 at 05:26 AM.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating Variable in on page and using it in different Flash page fazil_murthuza Flash & ActionScript 4 03-15-07 05:05 AM
PHP & FlashVars robtour PHP 4 08-22-05 08:18 PM


All times are GMT -5. The time now is 04:17 AM.
vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.2 (Unregistered)