Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2008-10-17
8
Medium Priority
?
855 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

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,…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
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 how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

670 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