guys please help..newbie here

i'm using macromedia flash 8..

i created a navigation button for my website...i used "iframe" in my html so the URL in my navigation will display on that frame..(i embed my .swfon my html)
i used this script on my flash

on(press)
{
getURL("#myurl", "mytarget");
}
everytime i press the button it opens another window


what probably the problem here... help me!

i can send you my .fla if you want

thanks!!!

Dani AI

Generated

Short answer for : the browser opens a new window when it cannot find a frame with the name you gave as the target. Your Flash call names a target, and the iframe in your HTML must have the same name attribute (not just an id). Also, using a fragment like #myurl will not load a separate file into the frame — use a real page path (or page#anchor if you need an anchor).

A quick check you can do: make sure your HTML has a named iframe, for example:

<iframe name="mytarget" id="mytarget" src="about:blank" width="800" height="600"></iframe>

Then use the same target name from Flash. If you instead want the link to replace the whole browser window, use _self (as pointed out). If you call JavaScript from Flash (ExternalInterface), add allowScriptAccess="always" to your embed/object and watch cross-domain rules.

If you still get a new window, paste your HTML embed and the iframe tag (or attach the .fla as offered) and someone here will spot the mismatch. For reference on how iframe naming and targets work, see the iframe documentation on MDN: iframe element.

hi there,
The code you provide is looking right i think there is no problem at all if you like to provide the .fla file then maybe i found the solution for you.

on(press)
{
getURL("#myurl", "mytarget");
}
everytime i press the button it opens another window

Leave the target blank or use _self for the target

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.