Forums | MacLife

You are not logged in.

#1 2003-03-03 12:59 am

Gipetto
Yankee Doodle's noodle
Royal Wombat
From: People! Ahg!!
Registered: 2000-09-24
Posts: 9938
Website

HTML talking to Flash

I know it's possible via the FS Command, but the manual is spotty at best and I'm still confused.

Can anybody offer up a good resource for learning how to get HTML to talk to Flash?
Basically what I want to do is make a head or link action that sets a flash movie to a certain frame. Pretty simple really but I'll be damned if I've been able to get it thus far.

Thanks
Shawn


So, just when did this place get Private Messages? YIKES!

Gippy Pages  |  Fuzzy Coconut XHTML Widget | PuppyCam

Offline

 

#2 2003-03-03 1:33 am

TonyPrevite
Slobbering Jester
Royal Wombat
From: Glendale, AZ
Registered: 2002-04-14
Posts: 3606
Website

Re: HTML talking to Flash

I'd forget about FS Commands, .... think along the lines of using a scripting language (like php) to set a variable with that link...and then using loadVariables in actionscript.

Remember HTML can't talk to anything...it's a formatting tool, nothing more. FS Commands use javascript as an avenue to pass values between the 2 environments, since it's client-side scripting, it's a little iffy with browser support.

Offline

 

#3 2003-03-03 8:13 am

Gipetto
Yankee Doodle's noodle
Royal Wombat
From: People! Ahg!!
Registered: 2000-09-24
Posts: 9938
Website

Re: HTML talking to Flash

Aw, c'mon - you were supposed to tell me it was easy and that I'd have it done in no time.

Lie to me damn, it!

Yeah, I haven't found it to be easy, as I'm not the best of freinds with Javascript either.
I'll try to pass it along via a PHP variable, that sounds like it might be easier...


So, just when did this place get Private Messages? YIKES!

Gippy Pages  |  Fuzzy Coconut XHTML Widget | PuppyCam

Offline

 

#4 2003-03-03 1:46 pm

Basseq
Fixxy of F&S fame
From: D.C.
Registered: 2002-12-18
Posts: 3093
Website

Re: HTML talking to Flash

It's all very easy and you'll have it done is no time.

Actually, I've never done it, but [THEORETICAL GUESSING AND VAST SPECULATIONS FOLLOW] I'd be something like <PARAM name="somethingorother" value="<?=$phpvar?>">. No idea though... Tony?


Basseq is me, John Whittet.
(Finishing the remainder of the thought expressed in the post has been left as an exercise for the reader.)

Offline

 

#5 2003-03-03 2:34 pm

Short Circuit
authorized airduct engineer
From: UESC Marathon
Registered: 2002-05-17
Posts: 4739

Re: HTML talking to Flash

I have made a highscore list in flash that is sent back nd forththough a PHP file...
I got the info here:
http://www.flashkit.com/tutorials/Games … /index.php

the only thing that is important is the GET and POST commands in actions.
look at page 4 of the tutorial, he explains it better then me.

W


Frog7blast the ventcore!

Offline

 

#6 2003-03-03 7:32 pm

Gipetto
Yankee Doodle's noodle
Royal Wombat
From: People! Ahg!!
Registered: 2000-09-24
Posts: 9938
Website

Re: HTML talking to Flash

Thanks for the link, I'll give it a look see.


So, just when did this place get Private Messages? YIKES!

Gippy Pages  |  Fuzzy Coconut XHTML Widget | PuppyCam

Offline

 

#7 2003-03-03 7:42 pm

Gipetto
Yankee Doodle's noodle
Royal Wombat
From: People! Ahg!!
Registered: 2000-09-24
Posts: 9938
Website

Re: HTML talking to Flash

After browsing around and looking at my options, I may be better off making small flash buttons for my purposes. It seems easier to get two flash movies to talk to each other than to get HTML/Javascript/PHP to do it and would be more consistent accross browsers.

I guess adding small movies won't be too bad, they got's ta have flash anyway's to view my site...


So, just when did this place get Private Messages? YIKES!

Gippy Pages  |  Fuzzy Coconut XHTML Widget | PuppyCam

Offline

 

#8 2003-03-10 1:01 pm

lateralis
Member
Registered: 2002-03-16
Posts: 687
Website

Re: HTML talking to Flash

yeah, I had a huge headache with this a while back.  Thankfully flash MX is better at it than previous incarnations.  here's the most important thing to know:

any variables that are appended to the query string to the ACTUAL FLASH MOVIE can get read in by flash no problem.

ex: "www.yoursitehere.com/flashmovie.swf?email=myname@mysite.com&name=myname"

you get it?  the hard part comes with a flash file wrapped in an HTML page.  If the values you want to send to flash are always the same you can just add the variables to the end of the movie call in your embed tags. as in :

<PARAM NAME=movie VALUE="flashmovie.swf?email=yourname@yoursite.com">

However, it seems like this is not what you are trying to do.  Have you played with the named anchor feature of flash MX (are you even using MX?)  I haven't tried it so mileage may vary, but as I undestand the way macromedia SUPPOSEDLY set up the anchor feature, you should be able to have regular <a href> tags with a URL like "thispage.html#frameinflash" which would then keep you at the same HTML page while moving the flash movie to the frame called "frameinflash" (when you name the frame, there is a checkbox to make it a named anchor.

Then again, if you're not using MX, this is all moot.  But I hope it helped anyway. wink

lateralis


"As far as I'm concerned, humans have not yet come up with a belief that's worth believing." -- George Carlin
"Faith is believing in something you know isn't true" --Mark Twain
www.modernatheist.com

Offline

 

#9 2003-03-10 2:13 pm

Gipetto
Yankee Doodle's noodle
Royal Wombat
From: People! Ahg!!
Registered: 2000-09-24
Posts: 9938
Website

Re: HTML talking to Flash

Lateralis,

I am using Flash MX.
If that works I owe you. I'm not working with variables. Basically what I want to do is add alternate navigation to a site that uses a flash movie in it's own frame for navigation. I want a user to be able to click on an HTML link and have the flash movie to update for the new page status. All my links will be hard links, no variable data - so what you propose sounds perfect.
I'll look into it.

Thanks for the help.

Shawn


So, just when did this place get Private Messages? YIKES!

Gippy Pages  |  Fuzzy Coconut XHTML Widget | PuppyCam

Offline

 

#10 2003-03-10 2:24 pm

lateralis
Member
Registered: 2002-03-16
Posts: 687
Website

Re: HTML talking to Flash

sure!

the first one will only work for what you're talking about if you make a function in flash that runs onEnterFrame.  an onEnterFrame function executes on everyt frame of the movie, at the given frame rate.  YOu could maybe set a variable to be checked and when it changes, move to a different frame:


mymovieclip.onEnterFrame(dothis);

function dothis() {
mymovieclip.gotoAndPlay(framenumpassedfromhtml);
}

(not sure how much flash and actionscript you know so forgive me if I'm talking down)  the above should work provided you have a main movie clip within which all your other stuff exists.  this is probably overkill for what you need to do.

I would definitely experiment with the named anchors, that will probably be your best bet.

lateralis


"As far as I'm concerned, humans have not yet come up with a belief that's worth believing." -- George Carlin
"Faith is believing in something you know isn't true" --Mark Twain
www.modernatheist.com

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson