View Full Version : ScrollBox External File Path problem. Pls make my day
feeverte
02-28-2006, 02:35 PM
I am using this scripts below to call a text file into a scrollbox and it works perfect when I play the swf on its own, but I need it to work in this context.
I have placed MC "main" on the index page. From the main menu I load succesfully the sub section menu page where the dynamic text box is.
At this point the text disappear. Error in my path?? Can anyone help? I still cannot work out the syntax for levels. Many Thanx.
fscommand ("allowscale", false);
loadVariablesNum ("scroller.txt", 0);
with the script on the MC named box (the slide element)
onClipEvent (load)
{
x_iniz = _x
y_iniz = _y
}
onClipEvent (mouseDown) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
gotoAndStop(2);
drag = true;
startDrag ("", false, x_iniz+1 , y_iniz, x_iniz+1, (y_iniz + _root.barra._height) - _height);
}
}
onClipEvent (mouseUp) {
gotoAndStop(1);
stopDrag ();
drag = false;
}
onClipEvent (enterFrame) {
prop = Math.floor(1+((_y-_root.barra._y)*_root.txt.maxscroll)/(_root.barra._height - _height));
if (drag) {
_root.txt.scroll = prop;
}
}
I have relative scripts on up and down arrow
tnx
feeverte
02-28-2006, 06:10 PM
Sorry but I have tried many time on many forums to get some answer.
I mean the questions may not be out of this world expert enlightening stuff but I do see lots of ''silly'' question around getting answered fast...
Anyway, after this rant, if u can bother, my script in need of help is in a few thread belows...
oldnewbie
02-28-2006, 06:45 PM
What do you mean by...Load it from my template I cant manage to call the text file?
Are you testing this locally through an .html, and that's what you meant by template, and if you are what browser are you using?
feeverte
02-28-2006, 06:52 PM
Hi wan
I was trying to make it clearer pls see above I have written a fresh.
For template (sorry designer talk) I just mean my main flash movie.
I created the layout with top graphic and menu and left the middle blank with the MC main".
Within the content which I called MAIN I call the other swf files.
Hope is clearer now
Ta
oldnewbie
02-28-2006, 07:18 PM
You should really get into using the LoadVars() object rather than loadVariablesNum, but to make your day, this is what you should do to make it work...
loadVariablesNum ("scroller.txt", 0);
When you use the above you're referencing the variables (in the text file) to level 0, or the main timeline, and that's why it works fine within the scroller movie itself.
The problem is then loading that scroller.swf in a container clip of a new main movie... Your loadVariablesNum action is still referencing the variables to level 0 or the main timeline, but level 0 is now the main timeline of the main movie and not the main timeline of the scroller movie itself. Get what I'm saying?
The solution is then to modify the variable in your scroller.swf textfield's VAR box, so that it points to the correct timeline to which the variables are now referenced to... Thus if your variable's name in your scroller.swf textfield's var box was my_var, simply make it _level0.my_var instead.
Have I made your day?
feeverte
02-28-2006, 08:02 PM
I am going to test it now thanx. It 9pm here I had to get my supper...
I will let u know.
And would like to know about your option if poss...
feeverte
02-28-2006, 08:15 PM
Something did happen...
oldnewbie
02-28-2006, 08:23 PM
Attach your .flas & text file, zipped up or mail them to me.
I'll provide an address through a PM, if you want to go the e-mail route.
feeverte
02-28-2006, 08:35 PM
yes please, PM ur email, and tell me what format i should stuff the fla i am mac user
thanx loads...
Never got a PM before...
oldnewbie
02-28-2006, 08:54 PM
Just PMed you... You should get a warning... If not hit the Private Messages link under your handle on the top-right of the page...
feeverte
02-28-2006, 10:23 PM
Thanks for you PM.
Hope u can help. Bye 4 now. Nite here
oldnewbie
03-01-2006, 03:19 AM
You must be sleeping by now... But tell me this when you read this...
Are you on MX only?
The new problem is that although I can get the text to appear (roughly in the manner I described earlier...), maybe did you confuse the number 0 with the letter O in my suggestion "_level0.txt" <- that's number 0 not the letter O, the scroller doesn't work anymore, once it's loaded in the other movie.
Easy fix if you were on MX2004, but you seem to be on MX only, is this right?
If it is, you'll either have to eliminate all of your references to _root in your scroller's actionscript, replacing them with the appropriate this or _parent, or else load this scroller movie on another level, rather than in a container clip, where no script changes would be needed.
oldnewbie
03-01-2006, 07:04 PM
So are you going to answer the above question?
You won't get anything from me until you do!
feeverte
03-02-2006, 04:40 PM
did answer via email...still...not getting anything from nobody... :-(
fv
vBulletin® v3.7.1, Copyright ©2000-2009, Jelsoft Enterprises Ltd.