Groups | Blog | Home
all groups > flash (macromedia) > january 2007 >

flash (macromedia) : Think I'm getting closer



xslamx
1/30/2007 10:35:47 PM
Ok, so after much help on this board and several internet tutorials, I've made
some headway with this animated nav bar I've been working on. I've still got a
couple of problems with it, though. I scrapped the idea of using button
symbols and dove into controlling movie clips with actionscript to act like
buttons. First off, the dynamic text for the buttons doesn't seem to work
(each button still says "text" even though I put in actionscript to dynamically
change the text of each button to it's proper word). Also, the animation seems
very choppy and I can't figure out why. Lastly, when I preview the swf, the
star in the buttons appears higher than the text, although when I go into the
button movie clip, it looks fine.Here's a link to the file...

http://www.sendspace.com/file/24ksna

I left in the original nav bar that has button symbols of text for reference.
If anyone can take a look at it and let me know where I went wrong I would
GREATLY GREATLY appreciate it! Thanks a ton in advance, take care...
ggshow
1/31/2007 3:23:15 AM
// modify script for your nav movieclip instance, Actions layer

b1.onRollOver = over;
b1.onRollOut = out;
[h]b1.buttonText.text = "CLOTHING";[/h]

b2.onRollOver = over;
b2.onRollOut = out;
[h]b2.buttonText.text = "ACCESSORIES";[/h]

b3.onRollOver = over;
b3.onRollOut = out;
[h]b3.buttonText.text = "EDGE NEWS";[/h]

b4.onRollOver = over;
b4.onRollOut = out;
[h]b4.buttonText.text = "HISTORY";[/h]

b5.onRollOver = over;
b5.onRollOut = out;
[h]b5.buttonText.text = "LINKS";[/h]

b6.onRollOver = over;
b6.onRollOut = out;
[h]b6.buttonText.text = "BOARD";[/h]

function over() {
this.gotoAndPlay("over");
}

function out() {
this.gotoAndPlay("out");
}
ggshow
1/31/2007 3:28:46 AM
few thing you should remember:

1) case sensitive
buttonText
not buttontext

2) the
b1.buttonText.text = "CLOTHING";
xslamx
1/31/2007 3:31:13 AM
Tried that and it didn't work (I still get the buttons coming up saying Text
instead of Clothing, Accessories, etc.) Any suggestions?

Also, anyone care to chime in on why the rollover animation looks choppy and
when you roll between buttons, both buttons animate choppily? And also on the
matter of the star being higher than the text?

Thanks for the help, take care...
ggshow
1/31/2007 4:43:57 AM
[b]BIG problem 1:[/b]
Some of the text boxes are getting cut off.
[b]Solution (a):[/b]
Increase the size for your buttonText dynamic textField so your longest text
can fit in it.
[b]Solution (b):[/b]
Set autoResize for your buttonText dynamic textField using script.

b1.onRollOver = over;
b1.onRollOut = out;
b1.buttonText.text = "CLOTHING";
[h]b1.buttonText.autoSize = true;[/h]

b2.onRollOver = over;
b2.onRollOut = out;
b2.buttonText.text = "ACCESSORIES";
[h]b2.buttonText.autoSize = true;[/h]

b3.onRollOver = over;
b3.onRollOut = out;
b3.buttonText.text = "EDGE NEWS";
[h]b3.buttonText.autoSize = true;[/h]

b4.onRollOver = over;
b4.onRollOut = out;
b4.buttonText.text = "HISTORY";
[h]b4.buttonText.autoSize = true;[/h]

b5.onRollOver = over;
b5.onRollOut = out;
b5.buttonText.text = "LINKS";
[h]b5.buttonText.autoSize = true;[/h]

b6.onRollOver = over;
b6.onRollOut = out;
b6.buttonText.text = "BOARD";
[h]b6.buttonText.autoSize = true;[/h]


[b]BIG problem 2:[/b]
They turn back to saying Text instead of the dynamic text for the rollover and
out.
[b]Solution (a):[/b]
Assign a same variable name to all the dynamic textField in your button
movieclip, you can find the "Var:" on property inspector.
e.g. set all Var: myvar

OK, now you get a BIGGER problem number 3, 4, 5, some chop choppy choppily
things... because your textField all have different size but you just apply
tweening like that... some buttons text overlap with another button, because
the space you provide is not enough to fit all text length...

ok, honestly I dont really agree the way u use, because:
When user mouse over, your button play frame 2 to frame 10 and stop, that is
animation from small to big;
When user mouse out, your button play from frame 10 to frame 20 and stop, that
is animation from big back to small;
These seem no problem, but think, if user mouse over, the button play, after
that before it play until frame 10, let say it is at frame 5 now, and user
mouse out, it just from frame 5 to frame 10 directly, cause your 1 choppy.

ggshow
1/31/2007 8:03:13 AM
this is another way, download the file below & try it 1st before i explain

http://www.ggshow.net/files/navnew2.fla
xslamx
2/1/2007 3:05:13 AM
Wow, that is amazing! Please let me know exactly how you did this, this is
just what I was trying to do and the animation is very smooth. I'm not exactly
sure what you did, but I didn't find any frame animation anywhere, did you do
everything with actionscript?

One problem though is that the text isn't showing up in the Squareslab font,
how can I change that? Also, when the star finishes animating larger, it's at
an angle and not straight up and down (small problem but if it's easy to fix
let me know).

GG, you rule, looking forward to your explanation!
ggshow
2/2/2007 5:52:07 AM
AddThis Social Bookmark Button