English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I have a .php page with this string
When you see it through you browser it displays "not currently logged in (Log in)" or "currently logged in, Mary"...
Now, I have put on that page a Flash header and I was wondering how can I make that string show up in Flash.
I am an absolute newbie. Please explain in detail.
Any help will be much appreciated . Thank you.

2006-09-21 09:35:10 · 4 answers · asked by Oz1981 1 in Computers & Internet Programming & Design

I have a flash file in the header. What code shall I write in the actonscript? should I create a textfield?

2006-09-21 09:48:52 · update #1

4 answers

PHP does not have a way to create Flash. You will have to either use ColdFusion (I think that works because they are both Macromedia/Adobe products) or simply include the php echos as html around the flash content.

2006-09-21 09:46:32 · answer #1 · answered by John J 6 · 0 1

There are a few different ways to pass variables into flash and use them while in flash for any purpose you'd like.

Since you've indicated you want the php echo statement on the same page where your flash file is embedded, you would probably want to go with a tutorial that shows how to pass variables into flash from javascript or a GET style link.

The explanations for those are quite lengthy, but try here for a sample:

http://www.manuelnegri.com/web_design/flash_tut1.htm




Otherwise, you could make your php statement a seperate file like menu.php and make it echo something like:

menu=blahblahblah

then in your flash file you can use the command:
loadVariables("menu.php", _level0, "GET");

and your menu variable would be accessible on the root level of your flash movie. (so you could create a dynamic text box on the root level and give it a Var: value of menu and your menu text would display in the text box when your movie is run)

**Note however, that if you use the loadVariables command, all your existing variables that are set in flash are also sent as a GET style string to your php script, so there is a disadvantage.

If your server is running php with register_globals on, your php script would define those values..just be aware.





---------

And just for the record......

You CAN create swf files from php.

http://us3.php.net/manual/en/ref.swf.php

2006-09-21 10:40:06 · answer #2 · answered by David 2 · 0 0

actually it's quite easy to do this with flash.

I assume you already have your flash file set up, recap, assign a variable to your textfield (ex var myTextField;)

now go to http://blog.deconcept.com/swfobject/:
download the zip files, you are going to need this.
extract the files, place the swfobject.js in the same directory of your html site files (preferbly inside a folder js)

Switch to your html file,
add this line of code under the title tag:


add some css scripts ex


-------------------------------------------
Between the body tag
you paste this code:








So wath happens:




Should a visitor don't have flash installed he/she can still see some text "logged in or not"
var so = new SWFObject("myFlash.swf", "myFlashName", "100%", "100%", "7", "#FF6600");
so.addVariable("myTextField", );
so.write("flashcontent");

this set of code adds your flash swf file inside the div tag "flash content"
the second line so.addVariable
your variable name of the textfield inside your flash file is: myTextField, and the value send to the textfield is: )

voila

2006-09-21 22:05:44 · answer #4 · answered by grahamdunn 1 · 0 0

fedest.com, questions and answers