Hi,
I made a scrollbar, dynamically attached to a dynamic textfield, and it looks fine when I publish in Flashplayer 6. When I switch to 7 however, the x_position jumps to the _x postion of the Textfield instead of the position I gave it (513). And I also made something to make the scrollbar invisible when there is not enough text, but in Flashplayer 7 I still can see an ‘inactive’ scrollbar.
Is it my coding that is maybe partly AS1.0 (I am terrible at that)? Or something with UI components and Flashplayer 7?
function makeArtikel(txt, c) {
var my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.onLoad = function(ok) {
if (ok) {
var field = NA1MC.NA1;
field.multiline = true;
field.wordWrap = true;
field.autoSize = false;
field.selectable = false;
field.html = true;
field.htmlText = this.firstChild.childNodes[c].firstChild.nodeValue;
field.setTextFormat(NA1fmt);
NA1MC._x = NK1MC._x-10;
//HERE I MAKE THE SCROLLBAR:
initialization = {_targetInstanceName:"NA1", horizontal:false};
NA1MC.attachMovie("UIScrollBar", "myScrollbar", 1, initialization);
//HERE I SET THE _X POSITION FOR THE SCROLLBAR:
NA1MC.myScrollBar._x = 513;
field.maxscroll = 16;
}
};
my_xml.load(txt);
NA1MC.myScrollBar.setSize(NA1MC._height);
//HERE I DO THE INVISIBLE TRICK, REFERRING TO THE MAXSCROLL 5 LINES UP:
onEnterFrame = function () {
if (NA1MC.NA1.maxscroll<=1) {
NA1MC.myScrollBar._visible = false;
} else {
NA1MC.myScrollBar._visible = true;
}
};
}
I hope someone can guide me, sorry if my coding is bad,
thank you,
Jerryj.