Skip to main content
Srihari_Ch
Known Participant
April 17, 2009
Question

Adding hyperlinks to customised Pop-up

  • April 17, 2009
  • 1 reply
  • 439 views

Hi all,

       I need to add as many number of hyperlinks to a custom "pop-up".

The properties for customised Pop-up are as follows:

           A pop-up is a retangle shaped figure with BackgroundColour = #FFFFCC, Width=170 and Height= 275 respectively mentioned in Properties Window. Here, Pop-up is a MovieClip and its instance-name is"myPopup".

         Now, i need to add text(which must act as hyperlinks, i.e., they must capture MouseEvent_CLICK event, should listen to the event and should produce response on clicking on the hyperlink) in vertical manner viz., the width,height and x-position should not change and only y-position for placing th text-field should change.

My code for creating a TextField with required width,height,x-pos and y-pos is as follows:

function createTextField(x:Number, y:Number, width:Number, height:Number):TextField

{

var result:TextField = new TextField();

result.x = x;

result.y = y;

result.width = width;

result.height = height;

addChild(result);

return result;

}

Now,using a "UIScrollbar", I need to scroll these added text(s) as soon as the text-fields added reaches maximum height of "Pop-up"(Movieclip).

Now, when I click on Cancel_btn, all text(s),scrollbar and the pop-up must be get closed.

You can see the attached file for the view of my output .swf file below.

I am new to Flash ans ActionScript 3.0.

Please help me in this context....

Thanks in advance...

Srihari.Ch

         

This topic has been closed for replies.

1 reply

Inspiring
April 17, 2009

If you want to rely on the Flash IDE to help you set this up, you can add a ScrollBar component as well as a TextField to the stage. In the component properties for the scroll bar, make sure that the TextField is the scroll target. Fill it with a bunch of dummy text, compile, and give it a try. If the scroll bar works correctly, you can move on and populate the TextField through code. Probably the easiest way to create a pile of links is to set html to true on the TextField, then to set htmlText to a long list of <a href="http://www.adobe.com/">Hyperlinks</a><br> for as many links as you need.