[thelist] Handling frames with Flash buttons

Jason Hepi contact at hepi.fsnet.co.uk
Wed Oct 23 09:13:01 CDT 2002


I've done a few demos/projects using Flash to control and trigger DHTML on a
page. The work was contained within nested framesets and in one case used a
set of Flash movie 'buttons' to control an embedded windows media player
(this was when people thought that like minded people would pay to watch
grainy video on their computers).

>From what I remember you basicaly need to get your flash movie to send 'out'
an FSCommand when something happens on the movie i.e. the user presses a
button. The following script 'catches' the FSCommand as a function call to
which you can then use conditional branches to execute code to do whatever
you need.

The following code worked for IE5.5 and NS4.7 - I haven't touched this sort
of thing for over a year now so I don't know if the more recent browser
release have support for Flash FSCommand or even how Flash MX now deals this
sort of thing but you should be able to find similar code via Google - in
fact a quick search reveals this link to Moock which is where I learned the
stuff : http://www.moock.org/webdesign/flash/fscommand/

<script language=javascript type="text/javascript">
<!--
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
function startReset_DoFSCommand(command, args) {
  var startResetObj = InternetExplorer ? startReset : document.startReset;

  if (command == "control" && args =="start"){
    PLACE CODE BLOCK HERE
  }

  if (command == "control" && args =="reset"){
    PLACE CODE BLOCK HERE
  }

if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 &&
navigator.userAgent.indexOf("Windows") != -1 &&
navigator.userAgent.indexOf("Windows 3.1") == -1) {
		document.write('<SCRIPT LANGUAGE=VBScript\> \n');
		document.write('on error resume next \n');
		document.write('Sub startReset_FSCommand(ByVal command, ByVal args)\n');
		document.write('  call startReset_DoFSCommand(command, args)\n');
		document.write('end sub\n');
		document.write('</SCRIPT\> \n');
}
//-->
</script>



To handle the frames part or your question - say you had a function you
wanted to call that is in a different frame to that which your flash movie
is in ... once the parameters from the flash movie have been caught by the
above code, and the correct conditional branch has been reached - you could
call the target frames function (depending on your frameset nesting) using
this syntax  :

top.parent.targetFrameName.start();

in this way you kind of navigate through your frameset to your target frame
and hence the document which is currently loaded into it and just call the
function you want which is made available by the loaded document. In your
case however you should be able to acheive a target frame location change
using :

parent.targetFrameName.location="page3.htm";

in this way you don't have to rely on the document in the target frame
having a function dedicated to window.location calls.

HTH

Jason Hepi







-----Original Message-----
From: thelist-admin at lists.evolt.org
[mailto:thelist-admin at lists.evolt.org]On Behalf Of Syed Zeeshan Haider
Sent: 23 October 2002 13:55
To: Evolt TheList
Subject: [thelist] Handling frames with Flash buttons


Hello Experts,
Some days ago, I asked a question about loading a web page in bottom frame
by
clicking a Flash button in top frame. I got only one response (it's not any
complain). I acted according to the response and assigned following
ActionScript
to the Flash button:

<ActionScript>
on (release) {
    getURL ("KeyCodeDetector.html", parent.bottomFrame);
}
</ActionScript>

It loaded the web page in NEW window instead of bottom frame.
Dreamweaver has a built-in system of creating Flash buttons in web pages. I
created a Flash button with DW in top frame and chose the name of bottom
frame
in Target field (in Flash Button dialogue box). This button loaded the page
neither in bottom frame nor in new window.
Now I have begun to think that may be Flash buttons just cannot handle
frames.
Is my above assumption right or wrong?

Thank you!

Syed Zeeshan Haider.
http://syedzeeshanhaider.faithweb.com/

--
For unsubscribe and other options, including
the Tip Harvester and archive of thelist go to:
http://lists.evolt.org Workers of the Web, evolt !






More information about the thelist mailing list