Hello!

I have a pre made flash website template and am using Mac Flash mxPro 2004. I cant seem to get the buttons to link to pages. I understand that I need to type in some code to do this yet I just cant work it out. Any help with this would be great.

Thanks!

Aikiman:)

Dani AI

Generated

Good progress — you already had the right idea and and pointed you in the right directions. A few practical notes that clear up the common pitfalls and will make the link behavior reliable across browsers.

If the SWF is embedded directly in a normal page, the usual target to replace the current browser window is _self. If the SWF is hosted inside a frameset or an iframe and you want the whole browser window to navigate, use _top (that forces the topmost window to change). Use the underscore form (_self, _top) — plain self can be treated as a named frame and is less predictable.

Quick troubleshooting checklist

  • Confirm the FLA is set to ActionScript 2.0 (Flash MX 2004 defaults to AS2). Mixing AS2/AS3 code produces compile errors.
  • Put your script on the clickable object (or use the correct timeline/frame). Instance-attached handlers work differently from timeline code.
  • Double-check frame labels and names (case-sensitive) if you use timeline navigation.
  • Test in a real browser — pop-up blockers can stop new-window opens, while same-window navigation usually works fine.
  • If the SWF is embedded via an HTML wrapper, confirm there are no frames/iframes you forgot about; _top is the fix if so.

If you ever move the FLA to a newer Flash/AS3 setup, the modern equivalent is navigateToURL. Example for AS3:

var req:URLRequest = new URLRequest("http://www.example.com");
navigateToURL(req, "_top");  // use "_self" or "_top" as needed

Final note: Flash-based whole sites are fragile long-term. For a maintainable site today, HTML/CSS/JS is the safer route. If sticking with Flash, keep publish settings and embedding HTML consistent so link targets behave as expected.

Recommended Answers

All 8 Replies

Thanks Peter thats a great website. I have tried doing that with some very messed up results. This is the code that came with the template:

on (rollOver) {
    gotoAndPlay("p1");
}
on (rollOut, dragOut) {
    gotoAndPlay("p2");
}

Any thoughts on what i need to do to get this code running?

Thanks

The above code if my memory does not fail me is to jump to a certain frame in the animation. You need to use getURL as described also in this tutorial for example

Thanks.
still getting erros but oh well think ill leave it and put it down to bad luck.

Just going to stick to html website templates from now on. And I thought photoshop was complex hahaha.

Thanks for your time peter :)

If your whole website is made in Flash, then that code would work. You just need to name frames P1 and P2 where you want to jump when those actions are performed.

If you want to go from Flash to a webpage, then you would use getURL like Peter said.

Yeah thanks. I have got it to work now I just need to make it open up in the same window when you click on it. This is the code.

on (release) {
    getURL("","_blank");
}

What do I need to do to make it open in the same window and not a new window?

remove the _blank for the target. I think you can put self or _self. I cant remember which

Link target attribute options

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.