Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2008-10-17
8
Medium Priority
?
859 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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
 
LVL 9

Accepted Solution

by:
asaivan earned 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

963 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