all groups > flash (macromedia) > may 2004 >
You're in the

flash (macromedia)

group:

problem in creatTextfield in createEmptyMovieClip


problem in creatTextfield in createEmptyMovieClip numem
5/26/2004 11:45:51 PM
flash (macromedia):
hi guys,
i am creating a rectangular movieclip with this code,
MovieClip.prototype.rectangle_1 = function(w, h, x, y)
{

this.moveTo(x, y);
this.lineTo(x+w, y);
this.lineTo(x+w, y+h);
this.lineTo(x, y+h);

};

var c1 = this.createEmptyMovieClip("clip", 1);
c1.lineStyle(1, 0x00aa00, 100);
c1.beginFill(0xffff00, 50);
c1.rectangle_1(360, 240, 130,-200);
c1.endFill();
c1.enabled=false;
c1.useHandCursor=false;

and i want to add many textfield in this movieclip , and each textfield' s
text has different hyperlink.

The textfield creating code is here:

createTextField("mytext",2,230,-160,50,30);
mytext.border = true;
mytext.multiline=true;
mytext.wordWrap=true;
mytext.html = true;
mytext.getTextExtent();
mytext.htmlText = "<A HREF='asfunction:callfunction'>"+content+"</A>";

in this case i have two question:
1. in the movieclip its showing hands when i roll over it, so that i
couldnt click my textfield
and i set the usehandcursor property false. still its coming.
actually i want to click the text and it has to go to the proper url.


2. how should i createTextfield using array

what i am doing wrong? could u pls guy tell me how to solve this.

Re: problem in creatTextfield in createEmptyMovieClip pazzoboy
5/27/2004 2:52:43 AM
Could you try this?
createEmptyMovieClip("clip", 1);
clip.lineStyle(1, 0x00aa00, 100);
clip.beginFill(0xffff00, 50);
clip.rectangle_1(360, 240, 130,-200);
clip.endFill();
clip.enabled=false;
clip.useHandCursor=false;
--------------------------------

For creating textfields from an array, I think you can do this:

tArray=new Array({ "mytext1",2,230,-160,50,30},{ "mytext2",2,230,100,100,30},{
"mytext3",2,230,160,150,30});
for(x=0;x<3;x++({
for(y=0;y<6;y++){
createTextField(tArray[x][y]);
}
eval(tArray[x][0]).border = true;
eval(tArray[x][0]).multiline=true;
eval(tArray[x][0]).wordWrap=true;
eval(tArray[x][0]).html = true;
eval(tArray[x][0]).getTextExtent();
eval(tArray[x][0]).htmlText = "";
}

Re: problem in creatTextfield in createEmptyMovieClip numem
5/27/2004 6:45:36 AM
thax pazzoboy,
i tried the following code,

MovieClip.prototype.rectangle_1 = function(w, h, x, y)
{

this.moveTo(x, y);
this.lineTo(x+w, y);
this.lineTo(x+w, y+h);
this.lineTo(x, y+h);

};

var c1 = this.createEmptyMovieClip("clip", 1);
c1.lineStyle(1, 0x00aa00, 100);
c1.beginFill(0xffff00, 50);
c1.rectangle_1(360, 240, 130,-200);
c1.endFill();
c1.enabled=false;
c1.useHandCursor=false;

and i tried to createempty movie clip without prototype also, but its not
working for me.
do u have any other sample?
Re: problem in creatTextfield in createEmptyMovieClip numem
5/27/2004 11:47:49 PM
hi pazzoboy,
this is what i am trying now , could u pls see this and tell me where i am
making mistake, actually the text in textfield should call the function
callfunction(), which is not working for me, thanks for ur help.

http://f2.pg.briefcase.yahoo.com/bc/sarovkavi/lst?&.dir=/&.src=bc&.view=l
AddThis Social Bookmark Button