View Full Version : open links from swf in same window
stefaneh
09-08-2007, 05:17 PM
Hello,
I have a map with hotspots as an swf file. I used snagit to make this file, this program let me only ad the url but the < _self > code. to open in the same window. Anybody has an idea or is there a script around for a swf file to force the clicked links to open in the same window
Thanks
da_mascus
09-09-2007, 07:48 PM
This is one trivial task, but I don't really get in what editor your working. Maybe if you could upload your *.fla file I could look into it.
Anyway flash absolutely has a choice availiable for the link target and even the self one :)
example of a button function in flash:
on (release) {
getURL("http://www.exampleurl.com/", "_self");
}
hmm I hope this helps, if no, pls provide more info or the file itself
stefaneh
09-12-2007, 02:55 PM
Thanks for you answer. I am using SnagIt which only produce a swf. file as output but not a fla. file. I even got in touch with support form SnagIt. there is not option.
However I was able to decompile the swf file. In the action script producet by SnagIT the links look like
HotspotXML = "<movie width=\"321\" height=\"426\"><hotspot shape=\'rect\' x=\'104\' y=\'36\' width=\'73\' height=\'91\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=40&Itemid=27\' color=\'\' alpha=\'0\' popx=\'100\' popy=\'131\' popid=\'h1\'></hotspot><hotspot shape=\'rect\' x=\'92\' y=\'132\' width=\'80\' height=\'45\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=23&Itemid=27\' color=\'\' alpha=\'0\' popx=\'89\' popy=\'97\' popid=\'h2\'></hotspot><hotspot shape=\'rect\' x=\'174\' y=\'82\' width=\'64\' height=\'83\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=22&Itemid=27\' color=\'\' alpha=\'0\' popx=\'173\' popy=\'47\' popid=\'h3\'></hotspot><hotspot shape=\'rect\' x=\'228\' y=\'112\' width=\'64\' height=\'66\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=24&Itemid=27\' color=\'\' alpha=\'0\' popx=\'225\' popy=\'62\' popid=\'h4\'></hotspot><hotspot shape=\'rect\' x=\'247\' y=\'58\' width=\'66\' height=\'75\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=21&Itemid=27\' color=\'\' alpha=\'0\' popx=\'249\' popy=\'8\' popid=\'h5\'></hotspot><hotspot shape=\'rect\' x=\'220\' y=\'171\' width=\'70\' height=\'74\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=25&Itemid=27\' color=\'\' alpha=\'0\' popx=\'223\' popy=\'151\' popid=\'h6\'></hotspot><hotspot shape=\'rect\' x=\'161\' y=\'165\' width=\'56\' height=\'65\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=42&Itemid=27\' color=\'\' alpha=\'0\' popx=\'144\' popy=\'145\' popid=\'h7\'></hotspot><hotspot shape=\'rect\' x=\'61\' y=\'157\' width=\'50\' height=\'64\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=26&Itemid=27\' color=\'\' alpha=\'0\' popx=\'56\' popy=\'122\' popid=\'h8\'></hotspot><hotspot shape=\'rect\' x=\'105\' y=\'219\' width=\'87\' height=\'53\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=98&Itemid=27\' color=\'\' alpha=\'0\' popx=\'105\' popy=\'199\' popid=\'h9\'></hotspot><hotspot shape=\'rect\' x=\'153\' y=\'243\' width=\'105\' height=\'56\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=30&Itemid=27\' color=\'\' alpha=\'0\' popx=\'170\' popy=\'208\' popid=\'h10\'></hotspot><hotspot shape=\'rect\' x=\'118\' y=\'288\' width=\'53\' height=\'28\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=35&Itemid=27\' color=\'\' alpha=\'0\' popx=\'110\' popy=\'268\' popid=\'h11\'></hotspot><hotspot shape=\'rect\' x=\'-1\' y=\'252\' width=\'65\' height=\'46\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=31&Itemid=27\' color=\'\' alpha=\'0\' popx=\'0\' popy=\'217\' popid=\'h12\'></hotspot><hotspot shape=\'rect\' x=\'53\' y=\'280\' width=\'28\' height=\'35\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=32&Itemid=27\' color=\'\' alpha=\'0\' popx=\'34\' popy=\'260\' popid=\'h13\'></hotspot><hotspot shape=\'rect\' x=\'204\' y=\'64\' width=\'25\' height=\'17\' href=\'http://www.immoportal.de/regional/hessen/kassel\' color=\'\' alpha=\'0\'></hotspot><hotspot shape=\'rect\' x=\'80\' y=\'275\' width=\'26\' height=\'34\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=33&Itemid=27\' color=\'\' alpha=\'0\' popx=\'55\' popy=\'240\' popid=\'h14\'></hotspot><hotspot shape=\'rect\' x=\'71\' y=\'303\' width=\'38\' height=\'51\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=36&Itemid=27\' color=\'\' alpha=\'0\' popx=\'52\' popy=\'268\' popid=\'h15\'></hotspot><hotspot shape=\'rect\' x=\'124\' y=\'285\' width=\'16\' height=\'19\' href=\'http://www.immoportal.de/regional/hessen/offenbach\' color=\'\' alpha=\'0\'></hotspot><hotspot shape=\'rect\' x=\'106\' y=\'269\' width=\'29\' height=\'38\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=34&Itemid=27\' color=\'\' alpha=\'0\' popx=\'88\' popy=\'234\' popid=\'h16\'></hotspot><hotspot shape=\'rect\' x=\'77\' y=\'357\' width=\'70\' height=\'64\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=39&Itemid=27\' color=\'\' alpha=\'0\' popx=\'79\' popy=\'322\' popid=\'h17\'></hotspot><hotspot shape=\'rect\' x=\'104\' y=\'319\' width=\'23\' height=\'30\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=37&Itemid=27\' color=\'\' alpha=\'0\' popx=\'81\' popy=\'299\' popid=\'h18\'></hotspot><hotspot shape=\'rect\' x=\'83\' y=\'234\' width=\'36\' height=\'48\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=29&Itemid=27\' color=\'\' alpha=\'0\' popx=\'66\' popy=\'199\' popid=\'h19\'></hotspot><hotspot shape=\'rect\' x=\'132\' y=\'342\' width=\'43\' height=\'67\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=41&Itemid=27\' color=\'\' alpha=\'0\' popx=\'118\' popy=\'307\' popid=\'h20\'></hotspot><hotspot shape=\'rect\' x=\'125\' y=\'315\' width=\'63\' height=\'36\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=38&Itemid=27\' color=\'\' alpha=\'0\' popx=\'121\' popy=\'265\' popid=\'h21\'></hotspot><hotspot shape=\'rect\' x=\'40\' y=\'207\' width=\'57\' height=\'45\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=28&Itemid=27\' color=\'\' alpha=\'0\' popx=\'28\' popy=\'172\' popid=\'h22\'></hotspot><hotspot shape=\'rect\' x=\'176\' y=\'12\' width=\'71\' height=\'74\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=19&Itemid=27\' color=\'\' alpha=\'0\' popx=\'181\' popy=\'90\' popid=\'h23\'></hotspot><hotspot shape=\'rect\' x=\'113\' y=\'181\' width=\'60\' height=\'48\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=27&Itemid=27\' color=\'\' alpha=\'0\' popx=\'113\' popy=\'146\' popid=\'h24\'></hotspot></movie>";
function onResize()
as you can see now I have a href I can edit but I am still not sure how and where this" _self code" needs to go. Would be great somebody can show me it on one example
Thank you
djr33
09-13-2007, 11:45 AM
See what happens if you add target="_self" to the tag.
stefaneh
09-15-2007, 11:13 PM
No luck so fare I have tried a few option but no luck. Just in case here is the code of the whole action script.
SnagItWidth = 321;
SnagItHeight = 426;
HotspotXML = "<movie width=\"321\" height=\"426\"><hotspot shape=\'rect\' x=\'104\' y=\'36\' width=\'73\' height=\'91\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=40&Itemid=27\"_self"' color=\'\' alpha=\'0\' popx=\'100\' popy=\'131\' popid=\'h1\'></hotspot><hotspot shape=\'rect\' x=\'92\' y=\'132\' width=\'80\' height=\'45\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=23&Itemid=27\' color=\'\' alpha=\'0\' popx=\'89\' copy=\'97\' popid=\'h2\'></hotspot><hotspot shape=\'rect\' x=\'174\' y=\'82\' width=\'64\' height=\'83\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=22&Itemid=27\' color=\'\' alpha=\'0\' popx=\'173\' popy=\'47\' popid=\'h3\'></hotspot><hotspot shape=\'rect\' x=\'228\' y=\'112\' width=\'64\' height=\'66\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=24&Itemid=27\' color=\'\' alpha=\'0\' popx=\'225\' popy=\'62\' popid=\'h4\'></hotspot><hotspot shape=\'rect\' x=\'247\' y=\'58\' width=\'66\' height=\'75\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=21&Itemid=27\' color=\'\' alpha=\'0\' popx=\'249\' popy=\'8\' popid=\'h5\'></hotspot><hotspot shape=\'rect\' x=\'220\' y=\'171\' width=\'70\' height=\'74\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=25&Itemid=27\' color=\'\' alpha=\'0\' popx=\'223\' popy=\'151\' popid=\'h6\'></hotspot><hotspot shape=\'rect\' x=\'161\' y=\'165\' width=\'56\' height=\'65\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=42&Itemid=27\' color=\'\' alpha=\'0\' popx=\'144\' popy=\'145\' popid=\'h7\'></hotspot><hotspot shape=\'rect\' x=\'61\' y=\'157\' width=\'50\' height=\'64\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=26&Itemid=27\' color=\'\' alpha=\'0\' popx=\'56\' popy=\'122\' popid=\'h8\'></hotspot><hotspot shape=\'rect\' x=\'105\' y=\'219\' width=\'87\' height=\'53\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=98&Itemid=27\' color=\'\' alpha=\'0\' popx=\'105\' popy=\'199\' popid=\'h9\'></hotspot><hotspot shape=\'rect\' x=\'153\' y=\'243\' width=\'105\' height=\'56\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=30&Itemid=27\' color=\'\' alpha=\'0\' popx=\'170\' popy=\'208\' popid=\'h10\'></hotspot><hotspot shape=\'rect\' x=\'118\' y=\'288\' width=\'53\' height=\'28\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=35&Itemid=27\' color=\'\' alpha=\'0\' popx=\'110\' popy=\'268\' popid=\'h11\'></hotspot><hotspot shape=\'rect\' x=\'-1\' y=\'252\' width=\'65\' height=\'46\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=31&Itemid=27\' color=\'\' alpha=\'0\' popx=\'0\' popy=\'217\' popid=\'h12\'></hotspot><hotspot shape=\'rect\' x=\'53\' y=\'280\' width=\'28\' height=\'35\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=32&Itemid=27\' color=\'\' alpha=\'0\' popx=\'34\' popy=\'260\' popid=\'h13\'></hotspot><hotspot shape=\'rect\' x=\'204\' y=\'64\' width=\'25\' height=\'17\' href=\'http://www.immoportal.de/regional/hessen/kassel\' color=\'\' alpha=\'0\'></hotspot><hotspot shape=\'rect\' x=\'80\' y=\'275\' width=\'26\' height=\'34\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=33&Itemid=27\' color=\'\' alpha=\'0\' popx=\'55\' popy=\'240\' popid=\'h14\'></hotspot><hotspot shape=\'rect\' x=\'71\' y=\'303\' width=\'38\' height=\'51\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=36&Itemid=27\' color=\'\' alpha=\'0\' popx=\'52\' popy=\'268\' popid=\'h15\'></hotspot><hotspot shape=\'rect\' x=\'124\' y=\'285\' width=\'16\' height=\'19\' href=\'http://www.immoportal.de/regional/hessen/offenbach\' color=\'\' alpha=\'0\'></hotspot><hotspot shape=\'rect\' x=\'106\' y=\'269\' width=\'29\' height=\'38\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=34&Itemid=27\' color=\'\' alpha=\'0\' popx=\'88\' popy=\'234\' popid=\'h16\'></hotspot><hotspot shape=\'rect\' x=\'77\' y=\'357\' width=\'70\' height=\'64\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=39&Itemid=27\' color=\'\' alpha=\'0\' popx=\'79\' popy=\'322\' popid=\'h17\'></hotspot><hotspot shape=\'rect\' x=\'104\' y=\'319\' width=\'23\' height=\'30\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=37&Itemid=27\' color=\'\' alpha=\'0\' popx=\'81\' popy=\'299\' popid=\'h18\'></hotspot><hotspot shape=\'rect\' x=\'83\' y=\'234\' width=\'36\' height=\'48\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=29&Itemid=27\' color=\'\' alpha=\'0\' popx=\'66\' popy=\'199\' popid=\'h19\'></hotspot><hotspot shape=\'rect\' x=\'132\' y=\'342\' width=\'43\' height=\'67\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=41&Itemid=27\' color=\'\' alpha=\'0\' popx=\'118\' popy=\'307\' popid=\'h20\'></hotspot><hotspot shape=\'rect\' x=\'125\' y=\'315\' width=\'63\' height=\'36\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=38&Itemid=27\' color=\'\' alpha=\'0\' popx=\'121\' popy=\'265\' popid=\'h21\'></hotspot><hotspot shape=\'rect\' x=\'40\' y=\'207\' width=\'57\' height=\'45\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=28&Itemid=27\' color=\'\' alpha=\'0\' popx=\'28\' popy=\'172\' popid=\'h22\'></hotspot><hotspot shape=\'rect\' x=\'176\' y=\'12\' width=\'71\' height=\'74\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=19&Itemid=27\' color=\'\' alpha=\'0\' popx=\'181\' popy=\'90\' popid=\'h23\'></hotspot><hotspot shape=\'rect\' x=\'113\' y=\'181\' width=\'60\' height=\'48\' href=\'http://www.fahrradnotdienst.de/index.php?option=com_sobi2&catid=27&Itemid=27\' color=\'\' alpha=\'0\' popx=\'113\' popy=\'146\' popid=\'h24\'></hotspot></movie>";
function onResize()
{
scrollPane.setSize(Stage.width, Stage.height);
} // End of the function
setProperty("", _quality, "BEST");
var si_xml = new XML(this.HotSpotXML);
si_xml.ignoreWhite = true;
var hsArr = new Array();
var l = si_xml.firstChild.childNodes.length;
var i = 0;
while (i < l)
{
var item = si_xml.firstChild.childNodes[i].attributes;
var ll = si_xml.firstChild.childNodes[i].childNodes.length;
var pointsArr;
if (ll > 0)
{
pointsArr = new Array();
} // end if
var j = 0;
while (j < ll)
{
pointsArr[j] = si_xml.firstChild.childNodes[i].childNodes[j].attributes;
++j;
} // end while
item.points = pointsArr;
hsArr[i] = item;
++i;
} // end while
var scrollPane = this.attachMovie("ts_scrollPane", "scrollPane", 1);
scrollPane.init(hsArr);
Stage.addListener(this);
Stage.showMenu = false;
Stage.scaleMode = "noScale";
Stage.align = "TL";
scrollPane.setSize(Stage.width, Stage.height);
delete hsArr;
delete si_xml;
delete this.HotspotXML;
getURL();
I attach 2 files. The first (hessen.zip) is the file (swf) which the program SnagIT produce. The second is a fla file I created with a Decomplier.
I really like to use SnagIT to make the files as I have to lot map like that to do and except the _self problem is great and fast to use.
Any help would be fantastic
1263
1264
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.