Solved

Flash FLV: Stop FLV with a link on the page?

Posted on 2008-10-17
8
840 Views
Last Modified: 2012-08-14
Hi all,

I've got a bit of a quagmire going here... I've got an .FLV that loads on my page above other content.  Fortunately, the .flv is wmode=transparent, which allows the underlying elements to show through.  Once the .FLV is done, it disappears...... but not really.  The containing DIV is still there.  And when you hove over the video, the control bar appears/disappears.  The width/height parameters of the div and flv persist in overlapping the content on the page.

My work around to this was to add a "hide" tab to the containing div.  The user clicks the hide tab, the div and its contained elements (flv) go away.

The problem here is that flv continues to play.  Its gone, but you can still hear it.  Is it possible to pass a flash variable to stop the video from playing when the user clicks on the hide link?

Thank you-
0
Comment
Question by:pmagony
  • 4
  • 3
8 Comments
 
LVL 9

Expert Comment

by:asaivan
ID: 22743518
I can't really tell you much, because I hate using Javascript and avoid it whereever possible due to cross browser implementations being wildly different in some cases, but you can use the flash External Interface class  to send signals to javascript code in your html file, to remove the DIV tag.  But that's about all I can tell you.
0
 
LVL 9

Author Comment

by:pmagony
ID: 22760232
My implementation is 98% Javascript. I  need to be able to stop the movie with a url string.  This is key.
0
 
LVL 9

Expert Comment

by:asaivan
ID: 22760634
0
 
LVL 9

Author Comment

by:pmagony
ID: 22760952
Yeah, that's not what I'm looking for.  I'm loading my content with an SWFObject, using JavaScript.  I've figured out that I need to use FlashVars to pass the parameters via a query string.

I've added the following to my js code:

so.addVariable('play', getQueryParamValue('play'));

which waits for the play query string to get passed via the URL.  The link that passes the parameters looks like this:

<a href="#?play=false">

However, this doesn't work because all 'play' does is specify whether the movie begins playing immediately on loading in the browser. I need to pass 'stop' movie, stop everything. Especially the audio.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 9

Accepted Solution

by:
asaivan earned 500 total points
ID: 22761004
Why is it not what you're looking for?  External Interface does exactly what (I think) you need it to do which is enable communication between Javascript and Actionscript.  From the Adobe website:

"From ActionScript, you can do the following on the HTML page:    * Call any JavaScript function.    * Pass any number of arguments, with any names.    * Pass various data types (Boolean, Number, String, and so on).    * Receive a return value from the JavaScript function.From JavaScript on the HTML page, you can:    * Call an ActionScript function.    * Pass arguments using standard function call notation.    * Return a value to the JavaScript function."

Basically you would need to have a Javascript enabled button or something, to pass a javascript object to actionscript, which would call an AS function...or do I not follow you correctly?


0
 
LVL 9

Author Comment

by:pmagony
ID: 22761137
what if I don't have access to the source .fla? This is an .flv file that I am loading.  Is what you are suggesting requiring me to add action script to the flash movie?
0
 
LVL 9

Expert Comment

by:asaivan
ID: 22761655
Yes, in order to use External Interface you would have to add code to the flash movie.  If you don't have access to the source code, then you're out of luck.  There's nothing you can do about it at that point.  And I can't think at the moment of any other way you could do it.
0
 
LVL 7

Expert Comment

by:TransBind
ID: 24536471
On Close action, try loading a no-existing flv
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Pushing Adobe Flash Player Fails with Error %%2 1 476
HTML 5 or Flash 7 480
free flash maker 5 206
Add 'birds singing' to homepage 5 100
This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now