• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Tip: Using JavaScript with Breeze Presentations

Guest
Apr 26, 2006 Apr 26, 2006

Copy link to clipboard

Copied

Hi all,

One of the reoccuring comments our alpha testers had was that there was no "close" button on the last slide of our Breeze presentations. Of course, Breeze doesn't give you any obvious ways to close the browser window, other than clicking the "x" in the upper right corner. But, since the Breeze viewer is contained within an HTML shell, the solution is really quite simple: use the "fscommand" global in Actionscript to activate a script embedded in the HTML page.

How-to
(1) Make a simple Flash movie, with a button. In this case, ours consisted of a small button that said "quit". In the first frame of the movie, add the following actionscript event handler:

btnName.onRelease = function () {
fscommand ("quit");
}


(2) Insert this button's *.swf file in the appropriate PowerPoint slide, and output the presentation to Breeze.

(3) Find the "index.htm" file in the Breeze output, and open it in notepad.

(4) Find the function "Sub SlideContent_FSCommand" in the vbscript section, and add the following code to the 'select case' function:

case "quit" window.close

(5) In case you're using something that doesn't understand vbscript (and I hope you are ) add the following function at the top of the javascript section:


function SlideContent_DoFSCommand (command, args)
{
window.close ();
}


Save the index.htm file, then reopen it in your browser like always. When the user clicks the button in the Breeze presentation, it will send the "quit" command to the browser, which will either handle it in vbScript or JavaScript.

Most of the time, we leave out the vbScript altogether so that all fscommands are handled by a big "case" statement in JavaScript. The only real issue I've run into doing this is that some JS methods for the Window object (and some Document methods, like .write() ) tend to fail.



Cheers!

~Marc B
TOPICS
Presenter

Views

532

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Deleted User
May 04, 2006 May 04, 2006
Hi all,

An even better way to execute small JavaScript commands (from within a Flash module) is to use the getURL command:

btnButtonName.onRelease = function () {
getURL ("javascript: window.close();");
}

That way, you don't need to mess around with the HTML for whatever page the viewer is embedded in.

Votes

Translate

Translate
Guest
May 04, 2006 May 04, 2006

Copy link to clipboard

Copied

Hi all,

An even better way to execute small JavaScript commands (from within a Flash module) is to use the getURL command:

btnButtonName.onRelease = function () {
getURL ("javascript: window.close();");
}

That way, you don't need to mess around with the HTML for whatever page the viewer is embedded in.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 23, 2006 May 23, 2006

Copy link to clipboard

Copied

Hey dudes,

It should look like this:

btnButtonName.onRelease = function () {
getURL ("javascript:window.close()");
}

gotta watch them syntax errors.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 23, 2006 May 23, 2006

Copy link to clipboard

Copied

LATEST
good eye, dude.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources