473,402 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

php vars to flash

anfetienne
424 256MB
Hi,

How can i pass a random digit that is created using a php var into flash so i can use it in AS. Once its in AS what would i write so that the digit is show in flash?
Mar 10 '09 #1
9 2333
Markus
6,050 Expert 4TB
Using flashvars.

Read: http://www.kirupa.com/developer/acti...gvariables.htm

Although, I'd suggest you use SWFObject to embed your flash and pass variables to the SWF.
Mar 11 '09 #2
anfetienne
424 256MB
thanks....i've just read through the blog page and I think it would be best to use SWFObject as well....seems much more safer and secure.....and more compatible with all browsers
Mar 11 '09 #3
Markus
6,050 Expert 4TB
@anfetienne
Sure thing.

Let me know if you hit any snags.

- Mark.
Mar 11 '09 #4
anfetienne
424 256MB
just a quick question.....when passing variables, i see in the swfobjec t they have it assigned to a dynaic text box. what i want is so that the variable is used only in actionscript....do i have to assign it to a text box or is there a way for this to just be used in actionscript?
Mar 12 '09 #5
Markus
6,050 Expert 4TB
You don't have to assign anything to anything.

Say you're passing the flash vars like so:

Expand|Select|Wrap|Line Numbers
  1. window.onload = function()
  2.     {
  3.         var flashvars = {
  4.             testFlashVar: "Hello from Bytes.com!"
  5.         };
  6.             var params = {
  7.                 wmode: "transparent"
  8.             };
  9.             var attributes = {};
  10.             swfobject.embedSWF([...]);
  11.     }
  12.  
In your AS, the variable is available by (at root) :
Expand|Select|Wrap|Line Numbers
  1. trace( testFlashVar );
  2.  
Does this help?
Mar 13 '09 #6
anfetienne
424 256MB
that's great.....thanks for that markus
Mar 13 '09 #7
Markus
6,050 Expert 4TB
@anfetienne
You're welcome.

- Mark.
Mar 13 '09 #8
anfetienne
424 256MB
just to double check if i send a php var to flash using SWFObject

say....
<?
$testVar = "anfetienne";
?>

window.onload = function()
{
var flashvars = {
testFlashVar: "<?PHP print $testVar;?>"
};
var params = {
wmode: "transparent"
};
var attributes = {};
swfobject.embedSWF([...]);
}

to be able to use testFlashVar in flash actionscript all i need to do is use

trace( testFlashVar ); to bring it in then afterwards i can put testFlashVar anywhere in the actionscript?

also should it be......swfobject.embedSWF(test.swf); or swfobject.embedSWF([test.swf]);?
Mar 20 '09 #9
Markus
6,050 Expert 4TB
1. Yep, that's correct.

2. Check out the documentation for SWFObject to understand how to embed it.
Apr 3 '09 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Drisco | last post by:
Hello, I realy need help,Searched the NG for a days with no vail. Sorry for the long script. I am trying to get a variable from php to flash. I have the following code in php <a...
3
by: jitu78 | last post by:
Hi, I want to pass some variable into flash on runtime. See this link, http://www.globtier.com/portfolio/in...?cat=webdesign If somebody clicks on any of project there, it should be...
2
by: xeo | last post by:
hey. am starting this really new web... its gonna be my very 1st ever since i always used to do it with flash but the thing is i need to learn how 2 design on dreamweaver (still websites) so lets...
8
by: Binx | last post by:
Please help! Does anyone know how to set up radio buttons to send their info from flash to a PHP script that will email me the results? I have been trying to get this thing to work for weeks, and...
2
by: Head In A Pan | last post by:
Hello! Here is something I assume is relatively simple but have never bothered to find out - I'm not finding the answer anywhere! All I am trying to do is this: Have a thumbnail image...
6
by: Ws | last post by:
Ok, so I have a question reguarding compilers and placing strings into the .rdata section of the PE. I was working on a program and couldn't figure out why I was getting a 0xc0000005 error...
1
by: Ronm | last post by:
Hey Guys, I have a problem which has been driving me crazy for the last days. I'm working on a small project involving: Visual Basic Acces Database ASP and adobe/macromedia Flash,
19
RMWChaos
by: RMWChaos | last post by:
Previously, I had used independent JSON lists in my code, where the lists were part of separate scripts. Because this method did not support reuse of a script without modification, I decided to...
3
by: jiwas78 | last post by:
Hey there guys, After some research into PHP and Actionscript, I think I have come close to doing what I want to do. Except now I'm stuck. Here is what I have in my header.php file: <?php...
6
anfetienne
by: anfetienne | last post by:
how can i post my $random_digit var to flash so that it can be used within flash actionscript?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.