Embed flash swf in G3 theme - how to?

hebhansen
hebhansen's picture

Joined: 2009-02-10
Posts: 572
Posted: Thu, 2010-03-18 20:22

I need this to run in theme. two paths inthere and nothing works. How do I cal the swf???? Filename Main.swf it is in the folder called "swf"

Quote:

<div id="frontbox" class="flow">
<h1 id="heading-front"><a href="/index.php/Categories">Categories</a></h1>
<!--url's used in the movie-->
<!--text used in the movie-->
<!-- saved from url=(0013)about:internet -->
<script language="JavaScript" type="text/javascript">
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0',
'width', '590',
'height', '300',
'src', 'Main',
'quality', 'high',
'pluginspage', 'http://www.adobe.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'Main',
'bgcolor', '#111111',
'name', 'Main',
'menu', 'true',
'allowFullScreen', 'false',
'allowScriptAccess','sameDomain',
'movie', 'http://www.skunk.agentura.dk/index.php/themes/monochrome/coverflow/swf/Main',
'salign', ''
); //end AC code
</script>
<noscript>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="590" height="300" id="Main" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="swf/Main.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /> <embed src="http://www.skunk.agentura.dk/index.php/themes/monochrome/coverflow/swf/Main.swf" quality="high" bgcolor="#000000" width="590" height="300" name="Main" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
</object>
</noscript>
</div>

all the best
HB - http://www.image.agentura.dk

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Thu, 2010-03-18 20:54

Why not use "/themes/YourTheme/swf/Main.swf" or "/swf/Main.swf"?

If you put the slash at the front like that it will specify a path from the root of the site. If you don't do that then it's based on the "path" you're in, in your Gallery.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
hebhansen
hebhansen's picture

Joined: 2009-02-10
Posts: 572
Posted: Thu, 2010-03-18 21:29

I tried all paths by now with or without /. I am aware of the root jump.

I also tried full path . http:// .................

So I am wondering this.... page.html.php does this file concider itself inside views, inside mytheme or at root?

all the best
HB - http://www.image.agentura.dk

 
hebhansen
hebhansen's picture

Joined: 2009-02-10
Posts: 572
Posted: Thu, 2010-03-18 22:06

Not sure what test site you mean..?

The one working is in an iFrame. I need to port it to my theme to get links in the frame working and also for getting album cover to the flash. The integrated flash is placed below and not displaying at www.skunk.agentura.dk

js is placed in page.html.php <head>
I created front.html.php and it reads fine.
I added the embed code to front.html.php

Related files are in place, 3 places now to get it right and I can not break this!!

all the best
HB - http://www.image.agentura.dk

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Thu, 2010-03-18 22:26

Didn't notice the iframe before. I think I see what's going on. Since the theme pages are just PHP, I think you may need to close out the PHP tags insert your javascript and then open the PHP tags, since I don't have the PHP source of your page/theme available, see this site for an example:

http://www.hotscripts.com/forums/php/30400-include-javascript-php-page.html
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
hebhansen
hebhansen's picture

Joined: 2009-02-10
Posts: 572
Posted: Thu, 2010-03-18 22:41

This is what I have. I created:

mytheme > js > flashcheck.js and dumped the script here

mytheme > views > page.html.php
I added in <head> (first line was there) -

Quote:
<?= $theme->script("ui.init.js") ?>
<?= $theme->script("flashcheck.js") ?>

in page.html.php <body> I added for a new front:

Quote:
<?= $theme->messages() ?>
<? if ($theme->item() && ($theme->item()->id == 1)): ?>
<?= new View("front.html") ?>
<? else:?>
<?= $content ?>
<? endif;?>

in front.html.php I have:

Quote:
<?php defined("SYSPATH") or die("No direct script access.") ?>
<h1>The Skunk Works</h1>

<div id="frontbox" class="flow">
<h1 id="heading-front"><a href="/index.php/Categories">Categories</a></h1>
<iframe src="/themes/monochrome/coverflow/flow.html" id="flow">
<p>Your browser does not support iframes.</p>
</iframe>
</div>

<div id="frontbox" class="flow">
<h1 id="heading-front"><a href="/index.php/Categories">Categories</a></h1>
<!--url's used in the movie-->
<!--text used in the movie-->
<!-- saved from url=(0013)about:internet -->
<script language="JavaScript" type="text/javascript">
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0',
'width', '590',
'height', '300',
'src', 'Main',
'quality', 'high',
'pluginspage', 'http://www.adobe.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'Main',
'bgcolor', '#111111',
'name', 'Main',
'menu', 'true',
'allowFullScreen', 'false',
'allowScriptAccess','sameDomain',
'movie', 'swf/Main',
'salign', ''
); //end AC code
</script>
<noscript>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="590" height="300" id="Main" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="swf/Main.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /> <embed src="swf/Main.swf" quality="high" bgcolor="#000000" width="590" height="300" name="Main" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
</object>
</noscript>
</div>

Works fine as standalone - works fine in iframe - embedded in G3, absolutely dead...

all the best
HB - http://www.image.agentura.dk

 
hebhansen
hebhansen's picture

Joined: 2009-02-10
Posts: 572
Posted: Thu, 2010-03-18 22:48

Related folders and files I placed:

1) inside views - not working
2) inside mytheme - not working
3) inside coverflow (custom) - not working

Files are in all positions now.

Paths for calling the swf I tried:

swf/Main.swf
/swf/Main.swf
../swf/Main.swf
../coverflow/swf/Main.swf
/coverflowswf/Main.swf
mytheme/swf/Main.swf
mytheme/views/swf/Main.swf
index.php/themes/mytheme/views/swf/Main.swf
/index.php/themes/mytheme/views/swf/Main.swf
http://mysite.com/index.php/themes/mytheme/views/swf/Main.swf
http://mysite.com/themes/mytheme/views/swf/Main.swf

all the best
HB - http://www.image.agentura.dk

 
hebhansen
hebhansen's picture

Joined: 2009-02-10
Posts: 572
Posted: Thu, 2010-03-18 23:02

I added this and page does not read

if($s == 0){
?>
<script></script>
<?
}

all the best
HB - http://www.image.agentura.dk

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Thu, 2010-03-18 23:24

your normal theme stuff here

//Let's close up the PHP
?>
<script> INSERT YOUR JAVASCRIPT FOR FLASH HERE</script>

You can put any old plain HTML here too

//Let's get back into the rest of the PHP for the page here
<?

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
hebhansen
hebhansen's picture

Joined: 2009-02-10
Posts: 572
Posted: Fri, 2010-03-19 07:23

Same as before - page notloading:

Quote:

<?php defined("SYSPATH") or die("No direct script access.") ?>
<h1>The Skunk Works</h1>

<div id="frontbox" class="flow">
<h1 id="heading-front"><a href="/index.php/Categories">Categories</a></h1>
<iframe src="/themes/monochrome/coverflow/flow.html" id="flow">
<p>Your browser does not support iframes.</p>
</iframe>
</div>

<div id="frontbox" class="other">
<h1 id="heading-front"><a href="/index.php/Skunk-Works">Flow for real</a></h1>
<p>Your browser does not support iframes.</p>
</iframe>
</div>

<div id="frontbox" class="flow">
<h1 id="heading-front"><a href="/index.php/Categories">Categories</a></h1>
<!--url's used in the movie-->
<!--text used in the movie-->
<!-- saved from url=(0013)about:internet -->
?>
<script language="JavaScript" type="text/javascript">
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0',
'width', '590',
'height', '300',
'src', 'Main',
'quality', 'high',
'pluginspage', 'http://www.adobe.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'Main',
'bgcolor', '#111111',
'name', 'Main',
'menu', 'true',
'allowFullScreen', 'false',
'allowScriptAccess','sameDomain',
'movie', 'swf/Main',
'salign', ''
); //end AC code
</script>
<?
<noscript>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="590" height="300" id="Main" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="swf/Main.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /> <embed src="swf/Main.swf" quality="high" bgcolor="#000000" width="590" height="300" name="Main" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
</object>
</noscript>
</div>

<div id="frontbox" class="flags">
<h1 id="heading-front">Select Language</h1>
</div>

all the best
HB - http://www.skunk.agentura.dk

 
hebhansen
hebhansen's picture

Joined: 2009-02-10
Posts: 572
Posted: Fri, 2010-03-19 07:28

I don't get this

We are in an area that allows html and the script is html tag'ed. So why jump in and out of php?

all the best
HB - http://www.skunk.agentura.dk

 
hebhansen
hebhansen's picture

Joined: 2009-02-10
Posts: 572
Posted: Fri, 2010-03-19 11:33

I have a feeling that without the php in/out something displays correct. The background is defined in correct size and color. It is z-index on top of everything as the iframe. So the styling is correct, but the content does not display.

It seems there are 3 places calling the file:

1) in script - 'movie', 'swf/Main',
2) in html - value="swf/Main.swf"
3) in html - src="swf/Main.swf"

Since I change path, wich ones needs update? All, 1 or 2?

all the best
HB - http://www.skunk.agentura.dk

 
hebhansen
hebhansen's picture

Joined: 2009-02-10
Posts: 572
Posted: Fri, 2010-03-19 13:16

Embedding Flash - how to:
http://www.longtailvideo.com/support/tutorials/Embedding-Flash

Didn't solve anything for me yet though :-(

I tried the SWFObject method
1) adding their js
2) adding their div
3) adding their embed code and call swf/Main.swf and also any other path

This does not seem to react to size change etc???

all the best
HB - http://www.skunk.agentura.dk

 
hebhansen
hebhansen's picture

Joined: 2009-02-10
Posts: 572
Posted: Fri, 2010-03-19 13:24

This is how I install JS in my theme. I assume this is correct:

Dump the js file in themes/mytheme/js/thefile.js

in page.html.php I add in <head>:

Quote:
<?= $theme->script("jquery.js") ?>
<?= $theme->script("jquery.form.js") ?>
<?= $theme->script("jquery-ui.js") ?>
<?= $theme->script("gallery.common.js") ?>
<? /* MSG_CANCEL is required by gallery.dialog.js */ ?>
<script type="text/javascript">
var MSG_CANCEL = <?= t('Cancel')->for_js() ?>;
</script>
<?= $theme->script("gallery.ajax.js") ?>
<?= $theme->script("gallery.dialog.js") ?>
<?= $theme->script("superfish/js/superfish.js") ?>
<?= $theme->script("jquery.localscroll.js") ?>
<?= $theme->script("ui.init.js") ?>
<?= $theme->script("flashcheck.js") ?>
<?= $theme->script("swfobject.js") ?>

Two last files I added. flashcheck.js checks the version of flash player and swfobject.js is described in the above link. It embeds, so that the embedding works for any browser, as opposed to <object> for IE and <embed> for everyone else. This method complies to xhtml.

Let me know if this is bad?

My guess is the G3 structure breaks the flash structure, but where?
all the best
HB - http://www.skunk.agentura.dk

 
hebhansen
hebhansen's picture

Joined: 2009-02-10
Posts: 572
Posted: Fri, 2010-03-19 13:30

Is it possible that:
<?= $theme->script("swfobject.js") ?>

breaks any other flash on the site?

all the best
HB - http://www.skunk.agentura.dk