Location of the MC

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 :slight_smile:

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.

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?

K, lost you, send me all he scripting, and let me see if i can see where u goin wrong

so just send you the .fla?

ok

hmmm anyone else have any ideas?

it’s probably because of the registration point of the movieclip. Is the stuff in your movieclip places at (0, 0)?

how do i find out if it is placed at (0,0) ?

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

x: -1.3
y: -41.3

change to 0,0 ?

yep :slight_smile:

ok i did that and ive played around with the values again, didnt seem to change anything :-\

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 = n**Y**start + 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.

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?

  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.

*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

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?

ok thanks, im pretty sure i know what you mean, ill see how i go with it :slight_smile:

good luck. :slight_smile: