Skip to main content
August 27, 2007
Question

Mucho text, one Dynamic Text Field

  • August 27, 2007
  • 14 replies
  • 1867 views
Okay, it didn't take me long to fudge this and I'm looking for the insight I know I don't have.

I have 30 instances, each with the attached onRollOver/Out functions. Now I'm being told that in addition to that, text must appear in a field below, and each instance must call a different piece of text into the same text box. I already have AS creating the box with the following attributes:

this.createTextField("txtAbstract", this.getNextHighestDepth(), 14, 352, 680, 85);
txtAbstract.type = "dynamic";
txtAbstract.multiline = true;
txtAbstract.wordWrap = true;

Ideally, to make this easier and scalable I would like to pull from an external text file (i.e., "abstracts.txt"), so that I can just have each abstract in the text file (#abstract1, #abstract2...#abstract30), that way when they want this project re-used, I just copy and paste the content into "abstracts.txt". This also means that I will need to have the text dissapear onRollOut (the text box remains blank until something is rolled over).

So here are my questions:
Can each instance have more than one onRollOver/Out event (one for the scale/slide and one to call from the text file and into a single dynamic text field)? The reason why it can't be an onClick is because that will be used to link people to a Web site in a separate browswer window.

In either case, is it possible to call in different text from a single text file into the same text field? Or will it be easier to have separate text files per abstract? I'm not adverse to the latter...

Any insight or help would be appreciated. Thanks!
This topic has been closed for replies.

14 replies

clbeech
Inspiring
October 3, 2007
congrats MrA, there you go!! job security LOL!!!!!

and you're welcome :)
clbeech
Inspiring
August 29, 2007
No sweat, keep us updated :)
September 11, 2007
It's still alive and kicking!

Unfortunately the client liked it so much, they are still making cosmetic changes and pushing back the release date by a week. HA! Ah well, at least it's just cosmetic changes.

Blah.

Nontheless I've finally had a chance to work on the second half of this module and have hit a small snag, I've started a new thread about it
<a target=_blank class=ftalternatingbarlinklarge href="[L=http://"<a]http://"<a target=_blank class=ftalternatingbarlinklarge href="[L=http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?catid=288&threadid=1299988">http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?catid=288&threadid=1299988">HERE.</a></a>]http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?catid=288&threadid=1299988">http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?catid=288&threadid=1299988">HERE.</a></a>
October 3, 2007
Final post on this subject:

Just wanted to give a grategful acknowlegement to the contributors on this thread. The project I used this one is now being deployed (but not public-facing, much to my dismay...I'd love to show the final results to you all) to our membership and has caught the attention of the executives. They liked it so much that they have asked other programs within the company to utlize the Flash project across the company. I could not have done it without the insight and help I recieved here. So a big THANK YOU to you all!
August 29, 2007
Sweet!

Yeah, I have some placeholders for the yet-to-be-created sound (which, to be honest is the least of my concerns at the moment), and I plan to have an onMouseUp event to link to an URL that opens in a new browser window, but I don't have the links yet.

I'll fiddle around with the scaling and speed to get it just right. Thanks!
clbeech
Inspiring
August 29, 2007
Ok, if you've left the code I had there, add this to line 80:

Abstract_txt.text = "";

it should be located within the 'hitTest' that sends the buttons back to their normal state, we're just putting a null string into the field. done deal :)
clbeech
Inspiring
August 29, 2007
hmmm... do you mean you want it blank when someone is not over a button?
clbeech
Inspiring
August 29, 2007
Great Mr.A, you're welcome. I had also noticed the 'flaw' in the RollOver/Out methods too, I think it might be due to the scaling overlaping the next hit area, not sure, try turning the scale down a little and see if that helps, maybe make the tween a little faster too, this might help 'catch' the next event sooner.

You've still got some things to do yet with the other events, and then getting the links set up (I'm thinking a separate text file and another LoadVar might be simplest, although you could get it out of the original text file string)

Let us know if you need more assistance, we've got your back :)

@GWD, yeah...lol...sometimes I just get stuck doing what I know, instead of trying something new ;) But that's great, one of my mantras is 'learn something new everday'... so you would think ... lol!
August 29, 2007
Okay...LAST question...

I need the text field to be blank until a button is rolled over, do I just add a "blank" (e.g. a space) abstract in the text file as a placeholder?
clbeech
Inspiring
August 29, 2007
@GWD, hey thanks man. I knew I'd seen that split line around somewhere, but couldn't remember, I'd tried a variation I think it was, s("\r").j(""); ... just haven't used plain text files much ...lol :) and I hadn't really grasped the full meaning of the subject you'd linked to earlier (went back and took a more thorough look), and wow can I see the ease of use now! I think actually easier to parse the scr string than iterating through the XML nodes .... HA! especially if dealing with large blocks of text.

right on :)
Inspiring
August 29, 2007
@cbeech. Yeah, the onData method lets you hijack the raw text data (actually you can do the same with the XML.onData method as well... you could just as easily use that instead of LoadVars) . I wondered earlier if you'd 'got' the point about not needing to use the name/value pairs like a regular LoadVars. Sorry I didn't explain more clearly here, but I did a lot of typing in that other thread and was being lazy.
Once you get used to it, its kinda easy yes... but I still personally would use XML in preference whereever I could, even if it seems a bit more work - but hey to each their own.
August 29, 2007
(gets up off floor after being knocked out of his chair)

That is AWESOME. You guys have really saved my bacon in terms of doing things the long way around (don't ask...it was going to involve timeline/frame lable jumping; effective, but overly tedious and not easily scalable). There's still a very minor bug in the roll overs don't always happen immediately and there doesn't appear to be a consistent factor, but given the choice between the "jittery" and the miss, I'll take the latter!

Thanks so much to the both of you for your input (CB, that's two I owe you now). While I definitely agree XML is more efficient and allows a higher degree of control, I can now just give this text "template" to my clients and they can simply put in the content and give it back to me when they are ready.

Odds are this is going to be live within two weeks, and I'll be more than happy to share the finalized product. Thanks again!
clbeech
Inspiring
August 28, 2007
I see, no problem, we can get it. We'll just delimit the text file (you want to use '[Abstract]' right?) and put the strings in an array, and assign them to the textfield on rollOver. I should have something for you in a little bit.
clbeech
Inspiring
August 29, 2007
Hey Mr.A - OK I've gotten a chance to go over this. I've made some pretty drastic changes, you don't have to use any of it though ;) Just thought I could help tiddy things up a bit for you. I've connected the Loadvars system and have included an example text file just for checking, except I just haven't been able to get the line break out of the string yet (GWD !!!). I also changed the way the the on handlers work, more in line with the version I'd constructed earlier. This way, the box will remain open if you move your cursor down to the 'click here' line so that you'll be able to click it ... :) I didn't put any functions in for this, and I didn't have the Minion font in my system so it was all a little weird. I changed the textfield creation and formating you had in there, it's not necessary to do this in the code, you can just place one on the stage and set the pararmeters that you wanted, I did this. Note: dynamic textfield need to be embedded individually, you can't make a single field that 'embeds' the font, although you can 'embed' a font within the document through the Library, but you have to then assign it to a field with the setTextFormat method, not necessary here.

I also threw in the alpha transition you were going for :)

Take a look see what you think, then you can start working on the URL links.

EDIT!!!!!! dang!!!! the FILE is in the post below .....
clbeech
Inspiring
August 28, 2007
Hey Mr.A - looking at the file now. Are you wanting text to be displayed in the box below, when you click on the drawer drop down?
August 28, 2007
Hey CB, thanks for peekin' into it!

Not quite. I would like for the text to be displayed during the roll over.

The intent is to have the user check out all of these attributes, see what applies to them, get a brief description of each sub/category in the text box below as they roll over each one, and if they're intereted, then they will click on the button/drawer, which will then open an URL in a separate browser window (hence why I'm saving the onMouseUp event for that).