all groups > flash data integration > february 2006 >
You're in the

flash data integration

group:

How do you add dynamic href's to .swf files


How do you add dynamic href's to .swf files atom heart
2/23/2006 5:19:42 PM
flash data integration: In a tool we developed a simple wizard tool that generates code (links)
dynamically for over 1200 diferent entities.It can create text links, button
image links and banner ads. We use Java script to make the call to a .asp page
which goes to the data base for that specific link with the unique ID for one
of those 1200 users. This works fine for adding an href for an animated .gif
file but with flash files it has to be embedded into the movie. Is there a way
to create one flash /.swf file that can have the possiblity of being wrapped
with 1200 different links? Maybe use some sort of variables inside the file?
Anyone have any suggestions . . .
Re: How do you add dynamic href's to .swf files srisumeet
2/25/2006 12:00:00 AM
Yes, there is. First of all, I assume you have the button (as a movie symbol or
button) created by now. Also as for it's instance name lets put it as . Once
you've placed the dynBtn onto the main stage. Select the Layer->Frame->Actions
on which you've placed the button an put this code:

_root.dynBtn.onRelease = function() {
getURL( _root.btnURL);
}

Now there's only one more thing to do in the ASP/HTML file of yours were you
have to embed this as SWF. Again i assume you must know how to publish the swf
and put it's code on to your web page. Further we need to have one <PARAM> tag
added to the earlier/default ones.

<PARAM name="flashvars value="btnURL=<%= aspDynamicallyFetchedURLVariable %>"
/>

Include this anywhere in between the opening <OBJECT> and <EMBED> tag and
further this will filter on to the flash button's action. Hope this helps you
out.


AddThis Social Bookmark Button