inserting flash object in php file

67 views
Skip to first unread message

Asimkh

unread,
Mar 3, 2009, 4:21:00 AM3/3/09
to SWFObject
Hi,

Q. Help me to know why flash CS3 giving error? i check attach fla file
is using AS.1.0, player 6
Q. Check php code if its right.

Currently am using a template and trying to decode it and putting
flash animation on main page
my website i.e. http://www.asim.net.pk
am using Flash CS3 i.e. playing 9 and actionscript 3.0

I download the SWFObject 2 and test it in Flash CS 3.0, during test it
gives error syntax error
#include expression.as ?

after checking help, i want to this code in my php file to test swf
i.e.

--------------------------------------
<?php $var['rain'] = $GLOBALS; ?>
<!-- highlight | generated by RainTPL v 1.0 | www.RainTPL.com -->


<script type="text/javascript" src="http://www.asim.net.pk/templates/
moling/highlight/swfobject.js"></script>
<script type="text/javascript">
//swfobject.registerObject("flashcontent_other", "9.0.0", "swf/
expressInstall.swf");
</script>
<center>
<div id="flashcontent">
</div>
<br/>
<div id="flashcontent_other1">
</div>
</center>
<script language="JavaScript" type="text/javascript">

var playerVersion = swfobject.getFlashPlayerVersion(); // returns a
JavaScript object
var output = "You have Flash player " + playerVersion.major + "." +
playerVersion.minor + "." + playerVersion.release + " installed";
var pVersion = playerVersion.major + "." + playerVersion.minor + "."
+ playerVersion.release; //alert(output);
swfobject.embedSWF("http://www.asim.net.pk/templates/moling/highlight/
asimnet.swf", "flashcontent", "638", "200", "9.0",

"http://www.asim.net.pk/templates/moling/highlight/
expressInstall.swf", flashvars, params, attributes );

</script>

<!--/ highlight -->
----------------------------------------

Currently am using following code for playing flash, but it doesnt
detect flash player due to
which on some website not having latest flash player, will not run
flash animation.

Code i.e.

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/
swflash.cab#version=10,0,22,87" width="638" height="200">

<param name="Asim.Net.Pk" value="asimnet.swf">
<param name=quality value=high>

<embed src="templates/moling/highlight/asimnet.swf" quality=high
pluginspage="http://www.macromedia.com/shockwave/download/index.cgi
?P1_Prod_Version=ShockwaveFlash"
type="application/x-shockwave-flash" width="638" height="200">

</embed>
</object>

Thanks!

Aran Rhee

unread,
Mar 3, 2009, 6:01:01 AM3/3/09
to swfo...@googlegroups.com
So, a few things:

1) Your swfobject.js include and embedSWF() code block should be in the
<head> of the document. The div you are writing to/replacing should be in
the <body> tag of the page.
2) You are attempting to pass in the variables flashvars, params, attributes
into the embedSWF() method, but you have not defined the variables or their
values
3) the #include expression.as error in Flash is nothing to do with SWFObject
- it means it cannot find the expression.as Actionscript file


I suggest you have a look at the SWFObject documentation and examples in a
static HTML file and then add the dynamic elements in the PHP file you
require after you have everything working in a static page (I don't see
where you are using any PHP code in relation to the swfobject part of your
page)


Aran
__________ Information from ESET NOD32 Antivirus, version of virus signature
database 3903 (20090303) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



__________ Information from ESET NOD32 Antivirus, version of virus signature
database 3903 (20090303) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


Asimkh

unread,
Mar 3, 2009, 7:36:59 AM3/3/09
to SWFObject
Hi,

Thanks for your reply.

1) I am editing, highlight.php file and inserting this code in it,
thats why not sure, its okay or not

2) Yeh i check and went through different example but still facing the
problem

I check this link to help i.e.
http://onflash.org/swfobject/
http://www.adobe.com/devnet/flashplayer/articles/swfobject.html

I put the following below code but when i test on my site, its stuck
on flash button to install flash player 10 but infact
already installed. I dont know why it stucked! anyways thanks for your
help, will try to solve the problem
but all examples i check the flash example files are done in Flash 6
or AS 1 or AS 2.0 even the actionscript expression
files are done in AS 2.0

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
var flashvars = {};
var params = {};
var attributes = {};
attributes.align = "middle";
swfobject.embedSWF("asimnet.swf", "myAlternativeContent", "638",
"200", "10.0.0", "expressInstall.swf", flashvars, params, attributes);
</script>
</head>
<body>
<div id="myAlternativeContent">
<a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/
get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
</div>
</body>
</html>

Aran Rhee

unread,
Mar 3, 2009, 4:31:19 PM3/3/09
to swfo...@googlegroups.com
Ok, so just to check that you do not have a corrupt flash player install on
your browser, what version of Flash does this page say you have?

http://www.bobbyvandersluis.com/swfobject/testsuite_2_1/test_api_getflashpla
yerversion.html

Also, do the basic example pages work for you (does Flash display?)
http://www.bobbyvandersluis.com/swfobject/testsuite_2_1/test_dynamic_params.
html

Once we know that your Flash player is working correctly, then we work on
your actual page.


Cheers,
Aran

-----Original Message-----
From: swfo...@googlegroups.com [mailto:swfo...@googlegroups.com] On
Behalf Of Asimkh
Reply all
Reply to author
Forward
0 new messages