Link to home
Start Free TrialLog in
Avatar of jeremypettit
jeremypettit

asked on

Newbie How-To Question About Creating A Link With Adobe LiveMotion

I just started working with Adobe LiveMotion, and I've made my banner, but I'm having troubles figuring out how to set it up as a link.

It doesn't work out inside anchor tags...
<a href=www.site.com>
<flash object>
</a>


I did try creating a big button to go over the banner, and give it a url in it's URL property of the Web window, but I need the link to open in a new page.

So I tried giving it a javascript command, which worked, but after the link is clicked, the banner is replaced with text: "[object]"

javascript:window.open("www.site.com");


I know this has to be easy to do, but I can't figure it out on my own. Can anybody help me?
Avatar of d2kagw
d2kagw

Hi There,

Welcome to the wonderful world of flash !!!

if you place a button on the stage of the flash file and place this code on the button it will work, no probs.

on(release)
{
     this.getURL("www.somesite.com", "_blank")
}

Hope this helps !!!
Hi jeremypettit,

I'm not sure that you can use html alone to make you're Flash clickable - unless you do something (slightly) dodgy like overlaying a transparent gif over it in a layer (the Flash would have to have a wmode of opaque or transparent for this to work), and adding the link to that instead.

The best way would be to add the link into Flash itself:  I'm not familiar with LiveMotion, but d2kagw has explained how it can be done in Flash.
Avatar of jeremypettit

ASKER

This doesn't work in LiveMotion or atleast my version (Windows - LiveMotion 1.02). It wants to look at it as a URL, and it errors if I place "javascript:" in front of it. For any object that I drop onto a flash file, I'm only seeing a URL property. I can add behavior for the entire project, but not per object. I did find a fix for making it a link, sort of, but it's not right. What I did, in the URL property of the big invisible button I dropped over my project, I set the URL to javascript:OpenLink("http://www.mysite.com");

Then I have to place a javascript function on my page which opens a new window. This works for me now, but of course it's not the desired result. Ultimately, I'd like the link to be embedded in the flash file and not dependent on the host page.

One other thing I noticed is that I seem to be able to only place one string of javascript in the URL field. For Example, when I tried to put this into the URL field "javascript:window.open('http://www.site.com','_blank');return false;", I would get a script error. This seems like such a simple and common thing that I can't believe Adobe didn't have a way to set this up.
A note about javascript:window.open - as of Windows XP Service Pack 2 it is unsupported, and probably wont work anyway!
Really? Wow, Microsoft is really changing things. I honestly haven't heard much good about service pack 2 yet, we haven't installed it here because of the bugs. Supposedly it would have some ill effects on some of our software here.
I'll never understand Microsoft. Just when you get used to something, they take it away. ActiveX for instance.

Anyways, I did find a spot to drop code in the behavior of objects, they keep it in a different spot that they do for the project. But I can still just run a single line of code in it, still doesn't like this.getURL, and displays "[object]" if I use window.open. I'll keep digging. Thanks for your help so far.
I'm still not sure whether this is the solution you are after, but you can put a transparent gif over a Flash movie to make it clickable, here's a link to a discussion on it:

http://www.ozzu.com/ftopic26720.html

I have used this technique myself - to overlay, and disable the Flash object underneath it.
Not really what I need to do, I want it all self contained, for then my banner can be distributed easier.
Sorry, then I guess you maybe need someone to post a reply with some experience with LiveMotion then :-(

Good luck :-)
Hey, it was worth a shot, right? Thanks for trying to help!
Figured it out. It was really simple, just not quite where one would think it would be. The behavior for different objects is in a different window section.

1.   I created a transparent square to overlay my banner.
2.   Then I selected the "Rollovers" window and added a "Down" event.
3.   In the "Down" event, I added a behavior of "Go To URL"
4.   Defined the URL I wished to navigate to and selected "_blank" as the frame (target).


Everything works as desired. A flash contained link opening in another window.
Cool, glad you got it sorted out :-)
ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial