PDA

View Full Version : location of the MC



TOOL
May 17th, 2003, 05:37 AM
in Jubba's actionscripted text tutorial, in the code explanation he writes this...


nXstart = 15 : sets the initial X position of the first movie clip

nYstart = 15 : sets the initial Y position of the first movie clip


i have been changing the values of these variables hoping to get the MC where I want it, but I havent been having much luck with it, am i changing the right variables?

also the text isn't spaced evenly, not too sure how to fix this

thanks :)

WelshDragoon
May 17th, 2003, 09:00 AM
Have you tred:

nXstart = 20, 30, 40, etc, whatever you want.
or
nYstart = 20, 30, 40, etc, whatever you want.

I don't know wha the rest of the scripting is like, but from what it sounds like, i would of fought that would work.

TOOL
May 17th, 2003, 09:11 AM
yeah i have tried, it moves it sort of where i want it but not exactly. what if i dragged the movie clip to where i want it on the stage and look at the properties box and see what the x and y co-ordinates are?

WelshDragoon
May 17th, 2003, 09:25 AM
K, lost you, send me all he scripting, and let me see if i can see where u goin wrong

TOOL
May 17th, 2003, 10:04 AM
so just send you the .fla?

WelshDragoon
May 17th, 2003, 10:09 AM
ok

TOOL
May 17th, 2003, 09:34 PM
hmmm anyone else have any ideas?

ahmed
May 17th, 2003, 09:59 PM
it's probably because of the registration point of the movieclip. Is the stuff in your movieclip places at (0, 0)?

TOOL
May 17th, 2003, 10:54 PM
how do i find out if it is placed at (0,0) ?

ahmed
May 17th, 2003, 11:25 PM
right-click the MC in the library, choose 'edit', press the Ctrl+A buttons, open up the properties panel and check the x: and y: values

TOOL
May 17th, 2003, 11:35 PM
x: -1.3
y: -41.3

change to 0,0 ?

ahmed
May 17th, 2003, 11:36 PM
yep :)

TOOL
May 17th, 2003, 11:39 PM
ok i did that and ive played around with the values again, didnt seem to change anything :-\

Jubba
May 18th, 2003, 01:48 AM
If you copied and pasted the code then there is a typo in the code. in the code that looks like this:


nChars++
if(nChars >= nLLength){
nReturn = text.substr(ii,1)
if(nReturn == " "){
nLNumber = nLNumber + 1
nChars = 0
}
}
ii++;
char.duplicateMovieClip ("char"+ii, ii);
_root["char"+ii].mcLetter.text=text.substr(ii-1, 1);
_root["char"+ii]._x = nXstart + nChars * nKerning
_root["char"+ii]._y = nXstart + nLNumber * nLSpace


the last line needs to be changed to this:

_root["char"+ii]._y = nYstart + nLNumber * nLSpace

When I gave Kirupa the original code I missed the typo (apparently:() Its calling the same varialbe for both X and Y values. That should solve your problem.

TOOL
May 18th, 2003, 01:55 AM
thanks Jubba, so just say i drag the MC to where i would like it on the stage, if i look at the x and y value of the MC location in the properties and i put those values into the code, will the text start from that location?

just another question, the spacing between the letters is a little uneven...do i have to play around with another variable?

Jubba
May 18th, 2003, 01:57 AM
1) yes those values would be where you want it to be (as long as you are doing it correctly)

2) no. That effect is for fixed-width fonts. Fonts that are not fixed widths will end up being weird. The only way around that would be to write a function that changes the kerning variable depending on which letter is inside each individual movieclip. I would rather switch fonts than write the function.

TOOL
May 18th, 2003, 02:00 AM
Originally posted by Jubba
1) yes those values would be where you want it to be (as long as you are doing it correctly)


hehe i think i am doing it incorrectly :-\

what is the correct way of doing it?

hmmmm writing a function...sounds complicated, i think i will switch fonts, thanks for the info

Jubba
May 18th, 2003, 02:10 AM
Well, remember that you are manipulating your MC. Probably tweening and moving it, so when the MC is on the stage is going to be in a different spot than after its played out?

TOOL
May 18th, 2003, 02:12 AM
ok thanks, im pretty sure i know what you mean, ill see how i go with it :)

Jubba
May 18th, 2003, 02:12 AM
good luck. :)