Insert Flash: {FLASH:file.swf,400x300}

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
Ibis Fernandez
Posts: 67
Joined: Tue 22. Jun 2004, 19:54
Contact:

Insert Flash: {FLASH:file.swf,400x300}

Post by Ibis Fernandez »

This tag works as follows:
{FLASH:URI,WIDTHxHeight}

URI = the addrees to the flash file.
height = the height of the file.
width = the width of the file.

This works perfectly well for me, but Im afaily new to PHP. So feel free to rewrite or improve it.

The file to modify is include/inc_front/front.func.inc.php

Find your way to the last replacement tag definition, in my case it was [BOOKMARK],

I'm not sure what the numbers in the following lines is...
$search[26]
$replace[26]

But jusging from the fact that it was being incremented as it went, I didnt want to rock the boat so what I did was simply include my piece of code as entry number 27. LOL You may need to use a du=ifferent number I suppose if you already have a 27. (Maybe some one can explain it to me.)

Any way, heres what the code looks like that you will add.

Code: Select all

// insert non db Flash standard
	$search[27]	 	= '/\{FLASH:(.*),(\d+)x(\d+)\}/';
	$replace[27] 	= '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="$2" height="$3"><param name="movie" value="$1"><param name="quality" value="high"><embed src="$1" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="$2" height="$3"></embed></object>';
Last edited by Ibis Fernandez on Mon 5. Jul 2004, 07:44, edited 1 time in total.
User avatar
jsw_nz
Posts: 907
Joined: Fri 2. Apr 2004, 02:42
Location: New Zealand

Hi Ibis

Post by jsw_nz »

Nice little addition...works fine. The swf object object and embed tags might be 'upgraded' at some stage, allowing parameters to be sent via flashvars. If I get something working, based on this repTag, will post here. :wink:

cheers,
jsw
Ibis Fernandez
Posts: 67
Joined: Tue 22. Jun 2004, 19:54
Contact:

Post by Ibis Fernandez »

Great to hear it worked well for you.

There is a very little known method for getting flash vars into flash QUITE EASILY, like php scripts you can actually send any set of variables and values into your flash movie by simply by formatting the url to your flash file as follows.

http://www.mydomain.com/myflashfile.swf ... le3=value3

This also adds an extra degree of functionally for example in places where phpWCMS already has certain parser tags defined such as {author}.

In flash you can have a field set to display whaever the value for {author} is... so to send this value into flash all you have to do is add the extra var/val pair to the swf url. such as http://domain.com/myfile.swf?author={author}.

phpWCMS will take care of defining the {author} tag with the appropriate value and such values will be imported into flash... nifty eh?


Also Note that the url is done twice to account for embbed and object methods so the the two url will have to be the same, other wise it will may not work on all browsers dempending on what they use, object or embbed.


Inside your flash file you will simply need to create field that will display the values for such variables.
Last edited by Ibis Fernandez on Mon 5. Jul 2004, 19:28, edited 1 time in total.
Ibis Fernandez
Cinestar Filmworks
http://flashfilmmaker.com
http://cinestarfilmworks.com
Author of Macromedia Flash Animation and Cartooning: A Creative Guide
User avatar
jsw_nz
Posts: 907
Joined: Fri 2. Apr 2004, 02:42
Location: New Zealand

Hi Ibis

Post by jsw_nz »

Thanks for your post. Great to follow that link into your Flash Filmaker website which uses Wcms! Kudo's on the website and community you are building. Yes you are right regarding the URL params. I have been exploring the FlashVars tag, which is equivalent, passing the unofficial {PAGETITLE} repTag to Flash. also have been experimenting with Oliver's frontend templates (article summary and listing) I have gotten Flash to load title/subtitle/summary/image/caption using these methods.


Great to see visit your site. Will likely join up!

all best,
jsw(john)

Update: just looking over your site...seeing your Toon Titan offering...impressive.
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

need a little help

Post by pSouper »

hi friends: I am having a little trouble getting this to work.
can someone post an example useage of this replacement tag mod?

I am using... {FLASH:img/article/myflash.swf} without joy
this is assuming the root dir is the same as the phpwmcs root.
I have tried a million others too.
edit: I got it now :oops: (I placed the code in slightly wrong place)

All is well now : thanks for the mod ;)

works in NAV_TABLE_COLUMN with a little adjustments
Ibis Fernandez
Posts: 67
Joined: Tue 22. Jun 2004, 19:54
Contact:

Post by Ibis Fernandez »

use the full url...

http://etc...

I did it this way so that it would allow the posting of swf file reguardless of where you keep it.
Ibis Fernandez
Cinestar Filmworks
http://flashfilmmaker.com
http://cinestarfilmworks.com
Author of Macromedia Flash Animation and Cartooning: A Creative Guide
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

Post by pSouper »

;) sounds good (although using phpwcms root as a starting points works too)

Is there a way the {FLASH:} tag can be modified to be a link too?
{FLASH:myflash.swf,width,height,link} ??
Ibis Fernandez
Posts: 67
Joined: Tue 22. Jun 2004, 19:54
Contact:

Post by Ibis Fernandez »

pSouper wrote:;) sounds good (although using phpwcms root as a starting points works too)
Yeah its should work as long as the path is right from the directory where your article is.
Is there a way the {FLASH:} tag can be modified to be a link too?
{FLASH:myflash.swf,width,height,link} ??
What exactly do you mean? You mean instead of displaying the movie you'd rather just display a link to the file?
Ibis Fernandez
Cinestar Filmworks
http://flashfilmmaker.com
http://cinestarfilmworks.com
Author of Macromedia Flash Animation and Cartooning: A Creative Guide
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

Post by pSouper »

sorry: no I mean use the movie as a button.
I have a flash icon (using your mod ) in the NAV_TABLE_COLUMN
but need to use the flash icons as a button/link to a variable... $link_name_id
dr.swank
Posts: 41
Joined: Sun 14. Dec 2003, 23:52

Post by dr.swank »

you could put a button in the flash icon and then use the getURL() method in flash. If you passed the url of the link to the flash file as noted above it should work fine.

inside flash:

var path
my_btn.onPress = function(){
getURL(path,"_blank");// or whatever tager you want to adress
}

then pass the var as above:

http://www.mydomain.com/myflashfile.swf ... abel="link text"

cheers, Doc
Image
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

Post by pSouper »

welcome back Dr S, I thought you'd run off to a desert island with 24 finalists from your favorite beauty padgent :)
oops: what i meant was... i havent seen you posting for a while :)

Thanks for the tip (by that i mean writting the code for me :D )
I will try this out for size and report back.
dr.swank
Posts: 41
Joined: Sun 14. Dec 2003, 23:52

Post by dr.swank »

thanx pSouper,

I started a new company and have been slammer with work! I am still working on FCMS as well, but between Wife, daughter (she is walking now!) and company I have just had no time :(

I am around though. So thanx for the welcome back.
Last edited by dr.swank on Thu 23. Sep 2004, 17:22, edited 1 time in total.
Image
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

Post by pSouper »

i do hope your new company (best of luck with that) has nothing to do with url's :D your last one is sooo (unexpectedly) wrong : hehe
actually the site look promising but is just a front page right? or did i miss something?
daughters are fun, I have two, now that your girl is walking you will have less time and more stress :) get a shlf load of herbal tea in, you're in for the long haul now ;)

am eagerly awaiting any further releases of your flashWCMS as i could not work out how to implement the current release at all :oops: but would fall over crying if I though work was to cease.
dr.swank
Posts: 41
Joined: Sun 14. Dec 2003, 23:52

Post by dr.swank »

i mistyped something in the url.. oopps :oops: FCMS will continue, but not quite yet. I hope to get some timne together to work it out. No promises as to when though.

cheers, doc
Image
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

Post by pSouper »

:)
Post Reply