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

flash (macromedia)

group:

the amazing Invisible Button


the amazing Invisible Button 06cjray
5/7/2005 12:00:00 AM
flash (macromedia):
I'm working through a tutorial book from lynda.com on intermediate and advanced
techniques in Flash MX 2004.

Currently, I've created a "master.swf" which then loads the shared library
with a trigger.swf and then immediately loads the first section into it
(about_us.swf.). I've gotten everything to load correctly with the exception
of one button on my "about_us.swf". Here's the technique it teaches:

Embed a dynamic text field within a movie clip. Then, using the TextFormat
class, assign different font faces/sizes to these buttons.

I have tried everything I know how and rechecked the actionscript countless
times. I know that the actionscript is correct and I don't think that is the
issue. It will not display the nested dynamic text field inside my movieclip
no matter what I do.....even if I completely remove any TextFormat
actionscripting from the picture. I've even created a new nested textfield to
see if that was the issue and it is doing the same thing.

Can anyone help? I'm going out of my mind.

-Thank you
Re: the amazing Invisible Button David Stiller
5/7/2005 12:00:00 AM
[quoted text, click to view]

Can we see this ActionScript? :)


David
stiller (at) quip (dot) net
"Luck is the residue of good design."

Re: the amazing Invisible Button 06cjray
5/7/2005 12:00:00 AM
Gladly.....here is all the actionscript for the about_us.swf that is being
loaded on top of the master container swf. Obviously not all of it pertains to
the buttons...but maybe there is a conflict that I'm not seeing? In any
case...the actionscript that doesn't seem to be doing anything is at the bottom
after the scroll buttons (textformat). Thanks.

//-------------<load CSS>--------------\\
var cssStyles:TextField.StyleSheet = new TextField.StyleSheet ();
cssStyles.load ("styles/styles.css");
cssStyles.onLoad = function (success) {
if (success) {
loadedInfo.styleSheet = cssStyles;
_level0.myLV.load("vars/ourHistory.txt");
} else {
loadedInfo.text = "There has been an error loading the Stylesheet. Please
contact the Webmaster and report your error. Thank you.";
}
}
//-------------</load CSS>--------------\\

//-------------<scroll buttons>--------------\\
this.scrollDown.onRelease = function () {
loadedInfo.scroll += 1;
}
this.scrollUp.onRelease = function () {
loadedInfo.scroll -= 1;
}
//-------------</scroll buttons>--------------\\

//create TextFormat Objects that define the states of the sub-menu options
var btnDisable:TextFormat = new TextFormat("Bitstream Vera Sans Bold Oblique",
12);
var btnEnable:TextFormat = new TextFormat("Bitstream Vera Sans Oblique", 11);

//disable the sub-menu option that corresponds to the currently-loaded section
this.ourHistoryMC.ourHistory.setTextFormat(btnDisable);

Re: the amazing Invisible Button 06cjray
5/7/2005 12:00:00 AM
Perhaps this http://othello.alma.edu/~06cjray/flash/flashHelp/ will help you to
better understand and see what I'm talking about.

[quoted text, click to view]

I've used the "insert target path" on the actionscript window. And even if
this WAS the case, wouldn't the default formatting of the dynamic text still
appear on the stage? It isn't being hidden by anything.

I ran the debugger on the project and everything seems to be in order as far
as I can tell. I think everything has loaded properly (but you can look at the
debugger picture above to check it out for yourself).

I guess my wording was a little funny with the "embedded dynamic text field".
It is a text field that was created with the text tool inside of a movie clip.
I double checked, it IS a dynamic text field.

I used the exact same movie clip in a new FLA and it appeared just fine. I
don't understand what the issue is. :confused;

Thanks for all your help.
Re: the amazing Invisible Button David Stiller
5/7/2005 1:00:54 PM
06cjray,

Your ActionScript looks perfectly okay (which you already said, and
which makes sense, given this is Lynda.com tutorial). That leads me to
suspect the problem is either with your pathing ...

// i.e.
this.ourHistoryMC.ourHistory.setTextFormat(btnDisable);
// Perhaps ourHistory isn't a text field, or it is not actually
// located inside this.outHistoryMC

.... or you are incorrectly loading something.

[quoted text, click to view]

You're saying this, I presume, because everything else is showing,
right? I wonder if the about_us.swf actually is loaded, but isn't visible.
Are you familiar at all with the Debugger panel? Instead of Control > Test
Movie, use Control > Debug Movie and you'll see the Debugger panel open for
you. You'll have to hit the green triangle arrow to start the SWF, but once
it does, you'll have visual access to all its movie clips, variables, and so
on (all the behind the scenes mechanisms). I'm curious if all your loaded
elements are available or not.

[quoted text, click to view]

This is probably just a matter of wording, but I'm not sure what you
mean by "embed" a dynamic text field. I know of two ways to put a text
field in place: A) use the Text Tool and B) use the
MovieClip.createTextField() method. In your case, it sounds like the text
field is already created (that is, you probably used the Text Tool) and it
should already be in your shared Library.

What happens if you simply drag the movie clip that contains this text
field onto the Stage? Try it in a new FLA, just to trouble shoot. Is the
text field actually dynamic, or did you leave it static by accident?


David
stiller (at) quip (dot) net
"Luck is the residue of good design."

Re: the amazing Invisible Button 06cjray
5/8/2005 12:00:00 AM
Re: the amazing Invisible Button 06cjray
5/8/2005 12:00:00 AM
Is it possible that it has something to do with the font family that I'm using?

Everytime I try to apply those font styles to my dynamic text they fields
disappear in my final .swf file. HOWEVER, when I apply the font-face directly
to a static text field....it works fine. What in the world is going on?
Re: the amazing Invisible Button 06cjray
5/8/2005 12:00:00 AM
Mr. Stiller,

First of all, thank you for all your help. It's been a frustrating few days,
but I'm glad that there was somebody willing to help me out. I finally got
everything working....but I don't exactly understand what happened.

I tried to start over creating all new files that simulate the same
circumstance that I was experiencing with the tutorial files. I actually got
the same problem with one of the fonts on that little experiment (interesting).
This of course made me very suspicious. For the experiement I used a
completely different set of fonts that I published in the shared library. Like
I said, same kind of problems.

I double checked everything and made sure that import/export for runtime
sharing was turned on in everything. In both cases, it was.....but then I
thought, maybe it's not recognizing that? So I tried something, I turned off
the "export for runtime sharing" option and re-published that swf. Then I
re-enabled the export option and published it again.

After that, it's worked just fine...everything works, even the "setTextFormat"
worked.

Strange....is it not?

It seems as if this were a bug that there would be other reports of it
wouldn't there? However, a bug is the only thing I can infer from this
situation. The problem occurred even after trying it on several different
computers and using various common and uncommon fonts. Who knows? All I know
is that it's working.

Let me know what you think? And, thanks again for all your help and patients.

Cameron Ray <><
Re: the amazing Invisible Button David Stiller
5/8/2005 2:26:51 PM
06cjray,

Howdy again. Sorry for the delay ... life kinda happens, you know? ;)

[quoted text, click to view]

It's interesting you suggest this, because I had thought of the same
thing. It would be part of the normal troubleshooting dance to try that
out, which it sounds as if you have ...

[quoted text, click to view]

.... are you saying this happens in other FLAs? If so, it may indeed be the
font family you're using. I would try -- in new FLA -- to create a text
field dynamically and apply the possibly troublesome font family, except
this time, embed the font in the following way:

In your Library, you'll find a small, clickable area in the right hand
side of the Library's title bar (the bar that toggles the Library open and
closed). Click on that right hand area, and you'll see where you can insert
a New Font... -- do that, and insert the font you want. You'll end up
giving this font a new name to distinguish it from the font on your sytem.
Using CSS (or whatever you prefer), use ActionScript to set the newly
created dynamic text field to the embeded, newly named font.

See if that makes your font show up. Also, try different fonts
altogether, just to make sure you're correctly creating dynamic text fields
on the fly.


David
stiller (at) quip (dot) net
"Luck is the residue of good design."

Re: the amazing Invisible Button David Stiller
5/8/2005 11:11:03 PM
Cameron,

Hey, glad you got it working! Sometimes ... sometimes it just doesn't
make sense, and as long as you're successful, that *can* be enough --
though, if you're like me, you're insane until you can figure out what went
wrong.

I only have vague guesses (as you've seen), so you may in fact have
found a bug, or maybe your file somehow got corrupt (or the font was
corrupt) ... who knows? If you want, you can send me your FLA and I'll try
it on my computer. Maybe I see the actual file, I'll notice something.
Worth a shot. If not, though, that's fine. Keep your chin up, in any case.
;) If you want me to take a look, replace the (at) and (dot) below with the
punctuation they should be.


David
stiller (at) quip (dot) net
"Luck is the residue of good design."

Re: the amazing Invisible Button Tony
5/9/2005 12:00:00 AM
Blah Blah Blah...
You can't trust the books.
Stop buying them.

If the people who write books about "How to" do Flash knew anything
then they would be making their living doing it instead of writing about it.

Your original post asked for advice - so here is some old style advice;
Stop reading books and get on with it.
If you want to become good at what you do then practice being good at
what you do.
Any fool can practice reading a badly written book.

Flash has two essential elements:
Animation and logic.
Learn both.
They are both old and ancient skills.

The books you want are in the least visited part of your local library.

PS - nothing worthwhile was ever easy
Re: the amazing Invisible Button 06cjray
5/9/2005 12:00:00 AM
Tony,

Thank you for that eloquent and well thought out response. I appreciate your
offering advice, however I was referring more to the problem that I was having,
not on your personal opinions.

Everyone has to start somewhere, if I happen to start with some "how to"
books, so be it......that makes me neither a fool or a sucker. There are some
good things to be learned in many books like that.

You'll have to forgive us, mere mortals, that aren't gifted with the art
knowing everything (as you seem to think you do).

Tony, life has one essential skill to master:

-if you don't have anything good to say, then don't say it

It might do you some good to learn that. Thanks again and appreciate all your
help.
Re: the amazing Invisible Button merlinvicki
5/9/2005 12:00:00 AM
Heh, that's because most of the people who should be reading them are in
these forums begging for hand outs.
I second that!
:)
Re: the amazing Invisible Button David Stiller
5/9/2005 12:14:04 AM
[quoted text, click to view]

Wow. While I agree there are plenty of weak books out there, they
certainly aren't all bad. Colin Moock's work is excellent. Joey Lott is a
good one. Phillip Kerman.

[quoted text, click to view]

Right. All of the above, in fact, make their living with Flash
(consulting, corporate work, freelance, etc., etc.). They happen to also
love the field, so they write books to help others learn. Kind of like
contributing to newsgroups, except more ambitious and better organized.

[quoted text, click to view]

The "get on with it" part is sound, but there's no harm in reading
books, as long as they're good ones.

[quoted text, click to view]

It sounds like you've only had bad experiences with books, which leads
me to think you're either just not a book learner or you've only had the
misfortune to read badly written ones.

[quoted text, click to view]

I don't know that I'd call animation "ancient," but it certainly has
been around longer than computers. Logic, of course, is truly ancient.
Good programming is definitely about logic.

[quoted text, click to view]

Heh, that's because most of the people who should be reading them are in
these forums begging for hand outs. ;)

[quoted text, click to view]

Ehh, I go back and forth on that. For sure, people in general should
try harder before looking for the silver spoon, but in fact, this poster
managed to solve the problem on his own. Good for him!


David
stiller (at) quip (dot) net
"Luck is the residue of good design."

AddThis Social Bookmark Button