Solved

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

Posted on 2008-10-17
8
837 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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…

757 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

23 Experts available now in Live!

Get 1:1 Help Now