Solved

Flash: link to external site doesn't work when swf is hosted elsewhere

Posted on 2010-11-22
10
751 Views
Last Modified: 2012-05-10
I have a problem with creating a link in a flash movie. The situation is as follows:

1) I have a flash banner with a link in it. In fact, the whole banner is a link (in the source file it's a transparent rectangle).
2) I publish the file, upload it to a webserver, all files in the same folder. I open the page, the banner shows, the link works.
3) I move the banner to another domain, edit the html to link to the proper location, reload the page, I still see the banner.
4) I click the banner, but nothing happens. The link doesn't work anymore.

Is this normal behavior? Do I need to load the banner from the same domain to prevent abuse or something? I've uploaded the files plus the source file so you can test for yourself.
flashlink.zip
0
Comment
Question by:R7AF
  • 5
  • 3
  • 2
10 Comments
 
LVL 44

Expert Comment

by:scrathcyboy
ID: 34191682
You should be able to load the banner and the flash from a different website, as long as you give a COMPLETE URL in the path --

http://www.othersite.com/flash/movie.swf

Check to see if the path is full like this.
0
 
LVL 13

Author Comment

by:R7AF
ID: 34192333
You misunderstand. The flash movie loads. I can see it. The only problem is that the link in the movie doesn't work, if (and only if) the movie is loaded from another domain.

The page: www.abc.com/test.html
Banner A: www.abc.com/banner-a.swf
Banner B: banners.def.com/banner-b.swf

Banner A has a working link. The link on banner B (e.g. to wikipedia.org) does not work. What I want to know is why it doesn't work? Am I doing something wrong?
0
 
LVL 44

Expert Comment

by:scrathcyboy
ID: 34192380
I got that the first time.  Neither links are FULL links.  Browsers have a better time with the WWW prefix, because they are used to that.  But the -- banners.def.com -- is not a normal link that can be decided by the browser to just put an http:// in front of it.

So as I said, SPECIFY THE FULL PATH, starting with http://  -- then whatever -- and they should work.
0
Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
LVL 39

Expert Comment

by:blue-genie
ID: 34194104
R7AF, sounds like a cross domain issue.
have a read here

http://www.flashperfection.com/tutorials/Flash-Cross-Domain-Access-85118.html
0
 
LVL 13

Author Comment

by:R7AF
ID: 34194823
@scrathcyboy
I wasn't clear, but I use a full link, so including http://. Sorry for the confusion.

@blue-genie
I'm afraid it is something like this. But I'm not reading data from another domain, I'm just linking to it. I can understand that this can be a problem because a malicious banner could redirect you to a different site, e.g. an almost exact copy with a very similar domain name, and that is a security issue because it will not be obvious all the time. I suppose that the crossdomain policy file should be hosted on the other domain, and that's a problem.
0
 
LVL 44

Expert Comment

by:scrathcyboy
ID: 34198445
flash files can link to external links and they do all the time.  If flash couldn't do this, it would be rather useless, wouldn't it.
0
 
LVL 39

Assisted Solution

by:blue-genie
blue-genie earned 500 total points
ID: 34202757
do i understand this correctly.

you  have 2 domains?
EXACT swf embedded in EXACT html files works on one domain and not another? or is the situation something else?
0
 
LVL 13

Author Comment

by:R7AF
ID: 34204000
@scrathcyboy
I think you misunderstand the situation. It's probably a security issue.

@blue-genie
Yes. The banner is hosted on another domain, not even a subdomain. See the mockup code below. The banner is hosted on banners.def.com, the page is on www.abc.com. I have tested this on different machines. When I put the banner on www.abc.com, the link works, when the banner is hosted on banners.def.com, it doesn't work.
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" 
	codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" 
	width="245" height="250" id="banner-paris-holiday" align="middle">
	<param name="allowScriptAccess" value="sameDomain" />
	<param name="allowFullScreen" value="false" />
	<param name="movie" value="http://banners.def.com/media/banner-paris-holiday.swf" />
	<param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />
	<embed src="http://banners.def.com/media/banner-paris-holiday.swf" quality="high" bgcolor="#ffffff" 
		width="245" height="250" name="banner-paris-holiday" align="middle" 
		allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" 
		pluginspage="http://www.adobe.com/go/getflashplayer" />
</object>

Open in new window

0
 
LVL 13

Accepted Solution

by:
R7AF earned 0 total points
ID: 34247098
I found the solution. I was trying to get the crossdomain.xml working today, which didn't result in the banner link working. Then suddenly I saw this parameter "allowScriptAccess", which was set to "sameDomain". I googled for it, then found that you could set this to "always", after which the link in the externally hosted banner worked.
0
 
LVL 13

Author Closing Comment

by:R7AF
ID: 34281015
I found the solution myself, and award blue-genie for the suggestions made.
0

Featured Post

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Tags from access to excel 3 38
How to count in a table in php 22 36
Only three borders showing on image 5 20
Javascript_Set_dropdown_value 7 33
If you thought ransomware was bad, think again! Doxware has the potential to be even more damaging.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question