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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

loading variable shown within MC - Please Help! 1

Status
Not open for further replies.

josel

Programmer
Oct 16, 2001
716
US
Greetings fellow FLASH'ers!

Today I am trying to load HTML from text file into a variable.

I have crated a MC with two bottons. Have AS on bottons to scroll text up/down ... Within the MC, I have a textbox (dynamic, HTML, multipleline) named ProductText.

I have created a text file (using notepad) with all the HTML code and text I want to load. I then added the action script to load the variable.

I cannot get it to work ... I have placed the AS in several places and have not been successfull. I tried first frame in timeline, I tried buttons and even first frame within MC.

The action script:

on (release) {
loadVariablesNum ("ProductText.txt", 0);
gotoAndStop ("products");
}

on buttons and:

loadVariablesNum ("ProductText.txt", 0);

on frames ... The textbox is within MC. The MC is on frame 26 with no name and it is a unique MC (not used anywhere else). The name of the textbox is ProductText.

Can some ome please help me out and tell me what I'm doing wrong?

Thank you all in advance!


josel If you have the knowledge, consult and educate those who need it! - Jose Lerebours
 
You have to give a instance name to your Mc and load the text with that target:

on (release) {
loadVariables ("ProductText.txt", "_root.MC_intance's_name");
gotoAndStop ("products");
}

Regards,
new.gif
 
Thanks Oldnewbie, it is working, some what ...

It appears that my use of ' confuses FLASH and it stops at that point ... possible believing that apos is a second variable of sort.

What's funny is that the text I have in my text file is the product of copy/paste from FLASH itself after entering the text in my textbox and copying from debug windows as I viewed/tested movie.

What's the work around for this?

Thanks in advance;

josel
If you have the knowledge, consult and educate those who need it! - Jose Lerebours
 
In Flash the & is in fact reserved to indicate the start of another variable.
You'll have to find the hexadecimal of the character you want, and use %0D for a carriage return or %27 for apos etc...etc...

Regards,
new.gif
 
Hey oldnewbie!

Thanks for the follow up. I am learning the hard way the dos and don'ts for loading HTML ... I find it disapointing that FLASH interprets new lines a carriage returns instead of following HTML standards.

I think it is cumbersome to write paragraphs in a long single line.

Oh, is there a way I can trick FLASH to product a list or the equivalent of <li></li>?

Regards;


Jose Lerebours
If you have the knowledge, consult and educate those who need it! - Jose Lerebours
 
Hey, they list &apos; as one of the supported tags and yet, it did not work for me. What's up with that?

The link is very helpfull oldnewbie, thank you!

Regards;


Jose Lerebours
If you have the knowledge, consult and educate those who need it! - Jose Lerebours
 
Did you checked the HTML box in the text options window??

Just a thought while passing by...

Hope it'll help ;-) Salut Old ça va? Have Fun...

Sharky99 >:):O>
 
Howdy SHARKY99,

Yes I did ... thanks for stopping by!

Does FLASH MX improve HTML standards' compatability?

IMHO, this is a major setback for FLASH as a front end to a server side program such as ColdFusion and ASP. I like to write portable programs and it seems that that will not be possible if FLASH is in the picture - BUMMER (or is it BUMBER?)! I still love FLASH and will continue to move forward full speed ahead ... After all, by the time I am developing real McDaddy applications with it, it will have everything I can possibly use :cool:

Regards;

Jose Lerebours
If you have the knowledge, consult and educate those who need it! - Jose Lerebours
 
Use the %27 method when reading from a text file.
The &apos; or any other only works when defining the textfield variable within the timeline itself as any other variable.

Regards,
new.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top