Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Referencing .TextField object from a loaded movie? 1

Status
Not open for further replies.

spook007

Programmer
Joined
May 22, 2002
Messages
259
Location
US
From my main movie, I'm loading another movie that creates a text field using the createTextField command. When I try to format the text field it will not format for some reason. I think it's because of the way I have it referencing the object and the depth level that I have assigned it. The textFields are created to display links loaded from a text file. I'm creating a textFile for each link and assigning each link to it's individual depth level. My guess is that's what causing the problem, but I don't know how to work around that. Any suggestions? Thanks!

height=(150-(10*totalAds))/totalAds


for (var i=1;i<=totalAds;i++){
_root.createTextField(&quot;link_&quot;+i,0+i,-10,height*i,50,10);
_root[&quot;link_&quot;+i].autoSize=true;
_root[&quot;link_&quot;+i].html=true;
_root[&quot;link_&quot;+i].htmlText=ad(i); // was displaying italics so I changed my array to () for display purposes.

linkFormat=new TextFormat();

linkFormat.url=&quot;asfunction:sendURL,&quot;+i;
linkFormat.underline=true;
linkFormat.color=0x000099;
linkFormat.target=&quot;_blank&quot;;
linkFormat.font=&quot;arial&quot;;
linkFormat.size=12;
linkFormat.bullet=true;

_root[&quot;link_&quot;+i].setTextFormat(linkFormat);
}
stop();
 
i am unsure as to exactly what you want to do. if its just to load a list of links from a textfile then im not sure this is the easiest way to do it.


look at links. if this is close to what you want let me know and i will send you the fla and text file.
 
billwatson;

That's along the lines of what I'm trying to do, would you mind sending me the fla and text file. Thanks!
 
Kay... I'm getting closer but still this isn't working quite as I was expecting.

I have a small marquee on the side that loads a random movie and plays it on the main movie. Once that movie is done, it is unloaded and another one is loaded. This last one is supposed to display a list of links.

The links should be simple! Blue text, underlined and clickable.

At the moment the last movie is being loaded, but the links themselves are not being displayed. If you roll your mouse over, you can see the mouse cursor change when it hits a hot spot, but the links aren't visible! Any guesses on what I need to change to make those links visible?

Here are my files!

 
Thanks a million...

path=_parent.parent

new concept for me... thanks!
 
it had to be a path problem so using path = _parent._parent
or whatever lets me make many quick changes without altering a lot of code.

and using parent i dont have to know the instance names of the movie clips or even if they have instance names.
 
I did notice thought that the links don't go anywhere now.
 
When you create a textfield and place it in _parent._parent, that's placing that object on the root of the main movie, is that correct? I noticed that when you close the marquee, the links remain on the screen as the marquee slides off to the side.

Why is it that when I try to make the URL on the loadmovie function to an absolute link things start to fall apart? Is it the way things are being referenced? When I posted the files on the server and tried to run it, the last part does not show.

 
give me 30 mins or so and ill have another look. kinda busy right now.
 
No rush... Thanks for giving me a hand!
 
ok i think that the links are now working...they trace ok..i moved the sendurl function into main...i cant test it as i run into sandbox security issues.

if you can test it and the links do now work then its just a matter of moving them when close button is pressed

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top