Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 799
  • Last Modified:

HOW to insert a 'href' link in flash within the actionscript.. (AS2)

hello, i have a flash application where i am loading data from mySQL into Flash.

All works good.  I have a text field called 'imageName' and it loads fine.

However, how can i insert a 'http://www.website.com/ ' before the 'imageName' so that it will open a link when clicked on?

Example.. currently it 'imageName' variable loads 'pic1' into flash.
HOW TO MAKE IT SO THAT THE USER CAN CLICK ON 'pic1' and have a '_blank' browser window open to this link:
"http://www.website.com/pic1.jpg"  ??


I know that  it would have to be hardcoded in the actionscript.. anybody know how to do it?

below is my working actionscript.
for (var i:Number = 0 ; i < parseInt(this.cant) ; i++){
		   
			
			this.ref._root.image_mc.imageName.htmlText = "" + this["imageName" + i] + "";
			this.ref._root.image_mc.imageHolder.loadMovie(this["imageName" + i]) + "";
			
		}

Open in new window

0
sam928
Asked:
sam928
  • 3
  • 3
2 Solutions
 
moagriusCommented:
this.ref._root.image_mc.imageName.htmlText = "<a target='_blank' href='" + this["imageName" + i] + "'>" + this["imageName" + i] + "</a>";
0
 
sam928Author Commented:
@moagrius.. that works GREAT!!

however, is it possible to take it one step further and put a caption in there that says 'CLICK HERE'  ?

I will open another question up .. and if you can help again that would be great.  Thank you!
0
 
moagriusCommented:
this.ref._root.image_mc.imageName.htmlText = "<a target='_blank' href='" + this["imageName" + i] + "'>CLICK HERE</a>";
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
sam928Author Commented:
@Moagrius.. WOW YOU ARE A GENIUS. THAT WORKS PERFECT..  wish i cud give you more points.
0
 
sam928Author Commented:
THANK YOU. GOD BLESS
0
 
moagriusCommented:
glad you got it working
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now