Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

auto load .swf file

Status
Not open for further replies.

kjmaclean

Technical User
Feb 21, 2009
14
0
0
US
Is this a pipe dream or a possibility with Javascript?

I have an html page with a button. The user pushes the button and the script opens a new window, loads a swf file, and auto plays it.

This seems like too much for Javascript, but I am new to JS and wonder if any gurus out there knew if this was possible.
 
It's very possible but, will users want to have pop-ups opening flashes? I personaly wouldn't visit your website again.

Anyway, user would need to have a swf player instaled, but appart from that, a window.open command with the swf file as target should do the trick.

Cheers,
Dian
 
Hi

I agree with Dian, neither I would visit that site again. ( Although with TargetKiller and Flashblock installed is not so annoying. )

But anyway. The OP mentioned "button", so there should be a [tt]form[/tt] too. And the [tt]form[/tt] can have [tt]target[/tt] attribute. Which can have "[tt]_blank[/tt]" value. So why the JavaScript ?
Code:
<form action="ugly.swf" target="_blank">
<input type="submit" value="Open Flash in new window/tab">
</form>

Feherke.
 
Thanks guys, that did the trick. Can't believe I didn't think of that myself, it was too simple. As usual with newbies to anything, I tried to make it too complicated.

I hate pop-ups too. This is for a little stand-alone app that a customer buys and puts on his desktop. It opens in an html page, and then the user clicks on a button. I use Javascript to display an animated Gif for 5 seconds, after which it opens up a funny little cartoon in another window. I needed to load and play the .swf automatically so the user doesn't have to click again to get the cartoon running.

Good show, and thanks a lot!

This is a great forum, lots of smart and helpful people around here.

:) Ken
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top