Basically I guess it is a reference problem I do have. (1120: Access of undefined property images)
For an image gallery I also do have a few text sprites which may have to much text for one side to display. Therefore I do have a scrollbar placed next to the text which should be able to move my text sprite within its mask.
My .fla at one point adds an InfoText (InfoText.as, extends Sprite) to an already existing sprite “images”.
imageHolderArray*=new InfoText (xmlName)
images.addChild(imageHolderArray*)
imageHolderArray*.name=xmlName;
The InfoText get’s the name of an xml file, then starts to load this xml file, populates text fields with it, etc. Work fine!
If the heigth of my textContainer sprite (create in InfoText.as) is taller than the display height, InfoText.as adds a scrollbar (Scrollbar.as, extends)
var scrollbar = new Scrollbar (xmlName,size,height)
addChild(scrollbar)
scrollbar.name=“scrollbarClass”
I pass on the xmlName to be able to address the correct sprite.
The scrollbar itself work fine (moving the slider), too, BUT I’m not able to move my text container.
I tried stuff like
Sprite(images.getChildByName(xmlName).textContainer).y=posY
and so on. But even
images.visible=fasle
won’t work from within Scrollbar.as. Usually it is a 1120: Access of undefined property images.
The target path displayed when I list all objects is as follows:
image=0 target="_level0.portfolio.images.EXHIBITIONS.scrollbarClass.scrollbar
and for the textContainer
image=0 target="_level0.portfolio.images.EXHIBITIONS.textContainer
Exhibitions is an example of what may be the content of the xmlName.
So, how do I point my line of code responsible for moving the textContainer from within Scrollbar.as at the textContainer sprite? Running against a wall since the last 6 hours and couldn’t find any proper tips on the web.
Any help is much appreciated.
Cheers!