Log in

View Full Version : Flash/actionscript 3 open url into an iframe



VonPeters
05-16-2008, 12:47 AM
Hey Guys here's the low down

I've done lots of design work (tons) but not a lot of code work.
Hence I'm pretty fresh at the script part.

Here's what I want to do.


I'm working in Flash CS3 actionscript3 I am building the html in
Golive CS2 but can use Dreamweaver CS3 if
it would work better for this>

I have built the intro page to my site in flash and have all the
buttons working to go to a new url for each page

I don't want the browser to open new windows.

Instead I want them
to open into the inline frame that the flash swf is in
so the End user can easily navigate through the site without dealing
with a mess of pages in new windows.

How do I do that? I didn't really understand the past post as to how
that was actually arrived at.

Can we please start fresh with this.

(here's the code I have)


photo_btn.addEventListener(MouseEvent.MOUSE_DOWN, photoHandler);
function photoHandler(event:MouseEvent):void {
navigateToURL(new URLRequest("http://www.mysite.com/
photography.html"));
}



and so on for each button.

Medyman
05-16-2008, 05:03 PM
The past post ( i suppose the one you emailed me about) was in ActionScript 2 using the getURL() method. That method has been deprecated in ActionScript3.

Your AS so far should be working. So, you just wanted to add the "target"?

Simple enough...

The navigateToURL() method takes the target as it's second parameter:

navigateToURL(request, '_blank');

So you just replace _blank with your iframe's name and you should be all set :D

mimeli
05-18-2008, 12:36 PM
Hi everyone!
Since I have a similar problem, I thought I'd post it here instead of opening a new thread.
(Hope this is OK!)
Me too, am a designer rather than a scripter.(And whatever scripting I know got pretty rusty from not using it for a long period of time..:rolleyes:)
I am currently working on a webpage, in which I'd like to put a "floating" .html page on top of a .swf page, whose buttons should control the .html page.

So far, I added an iframe to the page -as you can see here---> http://www.geocities.com/mimeli123/trial1.html (With Dreamweaver and the help of a friend..)...but I'm stuck:
It is blank(I would want it to open as a certain page, like "home.html")
and I don't know how to code the buttons on the .swf to inteact with the iframe(by clicking on the various buttons, only the content of the iframe should change to a different .html page)
:confused::confused::confused:

Can anyone help, please?
Consider me as a newbie to the whole scripting idea,please! :eek:..

Thnks in advance!

Medyman
05-19-2008, 02:04 AM
Are you using ActionScript 2.0 or 3.0 for this project? The code varies between these two languages.

mimeli
05-19-2008, 06:47 AM
I am using Action Script 2.0. Sorry I didn't mentioned it before.
Aaahh..and I found a way to insert the page I wanted as the "mother page" opens.

Thanks!

VonPeters
05-23-2008, 05:05 PM
Sorry I've been swamped with photo editing.

I'll give that target a try. I'm crossing my fingers :)

Cheers

75samsonite
05-31-2008, 09:04 PM
This video may help. It teaches how you can use flash buttons and links using actionscript 3.0

http://www.actionscript.org/forums/showthread.php3?p=751326#post751326

enviousmedia
05-06-2009, 10:22 PM
helllllo,
So i have a Navbar that i created in in flash with actionscript 2.0,
anyways i need the "button symbols" to open the HTML links for these buttons.... Does anyone have script for this...or does anyone know of a program that takes .SWF files and converts them back to .FLA??? because I have actually made a flash button open an Iframe but i lost the files all i have is the .SWF files.

If i cant script the button to open an iframe then does anyone know the scripting to just open a pop up window?

Thank for any responses..