Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Supporting Technologies > Server-Side Scripting

Reply
 
Thread Tools Rating: Thread Rating: 3 votes, 4.00 average. Display Modes
Old 03-03-2001, 05:32 PM   #1
retrocool
usually mistaken
 
Join Date: Feb 2001
Location: London UK
Posts: 60
Default

I am wondering what technology is most suited to my purpose.
What I'm trying to achive is this:
The reader is looking at a particular frame of my folio movie.
(S)he skips to another flash embedded html page to view related content.
She presses the 'back' button.
**The portfolio movie loads up and goes to THE SAME frame as she left it.**
This would involve the folio movie knowing where she had come from.

What is the best way to send this info from one page / movie to another?
I was about to try javascript until I read that javascript/flash interaction doesn't work on IE for mac, since it lacks ActiveX.
Since I use IE on a mac, I've gone off this idea!

Any offers?

retrocool

retrocool is offline   Reply With Quote
Old 03-04-2001, 04:47 AM   #2
Jesse
Administrator
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: Australia
Posts: 8,612
Default

PHP or CGI would be well suited to this kinda of thing, and since I've seen this question before I guess I should probably give a good example.

If your server supports PHP I can help you out, so let me know (reply here).

Basically all it involves is sending info from the flash document to the page which embeds the other flash document, then back again if nexcessary. The info (in the form of variables) is easily passed using the GET method and some simple PHP.

Cheers

Jesse
__________________
Cheers

Jesse Stratford
ActionScript.org Cofounder
Email: presented in this way to stop spam-bots: My email is composed of my first name (jesse) followed by my last name (stratford) followed by @ followed by actionscript.org

Please don't email or PM me Flash questions, that's what the Forums are for!

Please don't rely on me reading my PMs either. Email me about important stuff.
Jesse is offline   Reply With Quote
Old 03-05-2001, 10:16 AM   #3
retrocool
usually mistaken
 
Join Date: Feb 2001
Location: London UK
Posts: 60
Default

yes, god bless 'em, my servers support php.

So fire away with the explanation, and you will have my eternal gratitude!

retrocool
retrocool is offline   Reply With Quote
Old 03-06-2001, 02:47 AM   #4
Jesse
Administrator
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: Australia
Posts: 8,612
Default

OK. Here's the deal.
Take your HTML pages which embed the Flash movies and rename them to .php files.
Now find where the embed source if for your flash file.
Where is says:
Code:
<EMBED src="movie.swf"
Or the like, change it to this:

Code:
<EMBED src="movie.swf?skipTo=<?php echo $skipTo ?>"
Then, when you call your HTML (now PHP) document use:
getURL ("fileName.php?skipTo=" + skipTo);

This will take the value of the variable SkipTo and send it tot he PHP file you're loading. This PHP file then passes it into the Flash file it embeds.
Now in your flash file you can just have this:
if (skipTo !="") {
gotoAndPlay (Number(skipTo));
}

This checks if the variable skipTo has been passed (checks if it has a value) and if it has, it goes to the frame which skipTo dictates...

I've done this before succesfully but I'm just writing this out off the top of my head so if it doesn't work, lemme know.

Cheers

Jesse
__________________
Cheers

Jesse Stratford
ActionScript.org Cofounder
Email: presented in this way to stop spam-bots: My email is composed of my first name (jesse) followed by my last name (stratford) followed by @ followed by actionscript.org

Please don't email or PM me Flash questions, that's what the Forums are for!

Please don't rely on me reading my PMs either. Email me about important stuff.
Jesse is offline   Reply With Quote
Old 03-06-2001, 01:12 PM   #5
retrocool
usually mistaken
 
Join Date: Feb 2001
Location: London UK
Posts: 60
Default

cheers jesse!

works a treat! this is the last stage in a project that has been keeping me awake nights for months. Thanks from me, and thanks from my girlfriend who's sick of hearing about it.

(my g.f. is an auzzie like you, but unlike you she *lives* in stratford, rather than having it as a last name.)

Cheers - you da man,

retrocool

premonition. london.

[Edited by retrocool on 03-06-2001 at 07:53 AM]
retrocool is offline   Reply With Quote
Old 06-06-2001, 03:34 PM   #6
tranterra
Registered User
 
Join Date: May 2001
Posts: 24
Cool Whoa!

This doesn't have to do with php, but I just HAD to comment on your web site retrocool. Completely original and totaly "retrocool."

Keep up the good work.

tranterra
tranterra is offline   Reply With Quote
Old 01-30-2002, 02:20 AM   #7
Vlaad.t.I
Registered User
 
Join Date: Jan 2002
Location: Australia
Posts: 1
Send a message via ICQ to Vlaad.t.I
Question Removing a step

Mmm... finally found this post. I've been looking for a thorough explanation re: how to use variables properly. I've seen a lot of tutorials, but they were lacklustre at best.

You, however, have dun good! Dun real good!!!


Anyways... question time...

I'm working with a company being hosted at webcentral, and though I spoke to the tech support guys there, pleading the case of PHP, they said it was too unstable ('sif!) to run on their precious servers. (Nevermind the fact I can crash an entire server with a single line of iNETstore code ).

Slapping myself back to the topic, I've got no trouble passing the variables using getURL(), and the URL in the location bar of the browser shows the correct variable-key/value pairs, but the flash file won't recognise them (perhaps due to the fact that there's 5 flash files within the one HTML page), and with just HTML to aid me (unless I move into CF, which I was trying to avoid because of the massive increase in cost/month) there's nothing that can help to generate this:

<EMBED src="movie.swf?var=<?php echo $value ?>"

Can anyone see a way around my problem???

Please help ASAP, as this is really holding up the works.

PS. Please forgive the smilies... It's my only stress relief atm...
Vlaad.t.I is offline   Reply With Quote
Old 08-27-2004, 03:31 PM   #8
anim8rx
Registered User
 
Join Date: Aug 2004
Posts: 1
Default

Hey Jesse - Thanks for the explanation above works great! One problem I seem to be having is seems to need to reload the swf when I add the ?varname=1 to the URL address. Any ideas - the swf Im loading is large enough for a loader, otherwise it wouldnt be evident what is going on.
anim8rx is offline   Reply With Quote
Old 10-10-2005, 11:37 AM   #9
plink
Registered User
 
Join Date: Sep 2005
Posts: 7
Default Another great way to do this

As this thread explains, you can through the embed tag tell flash whcih page you came from. But how do you know what page you came from? The back button will take you back to the page you came from, but doing as suggested here will take you back to the page you think that person most likely came from.
By using the $_SERVER['HTTP_REFERER'] supoerglobal you can create a simple back link like this

print "<a href=\"".$_SERVER['HTTP_REFERER']."\">Go back</a>";

that essentially does the same as the back button.
Now, if the page you came from can somehow store the position in the videoclip that you need to go back to. Say the URL is =

www.somesite.com/somefile.php?thispage=weather

you can have that particular page produce the swf sting like this

<param name=\"movie\" value=\"flashfile.swf?thispage=".$_GET['thispage']."\" /><param name

Get it. Start using the $_SERVER['HTTP_REFERER'] immidiatly and make nifty back buttons that greatly aid navigation for people not so used to surfing the net.

JT
plink is offline   Reply With Quote
Old 11-02-2005, 03:09 PM   #10
vinnevin
Registered User
 
Join Date: Nov 2005
Posts: 10
Default loading problems

Hello

This php code causes problems:

<body>

<object width="685" height="755" classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0">
<param name="movie" value="http://www.cikmedia.com/ski/blogg/<?php echo $nm; ?>.swf">
<embed src="http://www.cikmedia.com/ski/blogg/<?php echo $nm; ?>.swf" width="685" height="755"></embed>
</object>

</body>

The swf file reads a rss feed, but the pictures and text does not appear when i use php. It works fine with html.

Can anyone tell me why?

PS. Sorry about my english, I'm norwegian.
vinnevin is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending a PNG to Actionscript from Javascript headkaze ActionScript 2.0 0 05-24-2006 03:49 PM
PHP + Actionscript problem Grofit ActionScript 2.0 9 03-27-2006 10:44 PM
Actionscript function to PHP function ... Reflex Server-Side Scripting 3 09-06-2005 07:33 AM
Actionscript / Javascript / HTML geakem ActionScript 1.0 (and below) 0 09-01-2005 10:46 PM
New window with javascript or actionscript? chrishosch ActionScript 2.0 0 05-07-2004 12:39 PM


All times are GMT. The time now is 01:50 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.
You Rated this Thread: