PDA

View Full Version : Problem with actionscript in ScrollPane



Bill12
August 19th, 2007, 06:10 PM
Hello,
I have this code for generating the attached movies in a scrollPane

var ins:MovieClip;
function init() {
//empty movie clip in library with linkage name "scrollMovieClip"
scrollPane["borderStyle"] = "none";
scrollPane.contentPath = "scrollMovieClip";
ins = scrollPane.content;
}
init();


and i have a button in the attached movie called "squares" and loads info from an XML to open a URL linso i have a code like this...

_root.webs = _root.ins["squares"+count]["Company"+(t+1)].WEBSITEBut; _root.ins["squares"+count].website_but.onPress = function() { getURL(webs, _blank);
};

But doesn`t work with the ScrollPane.

Can anyone help me make this button Functional?????

Thanx

RaymondP
August 19th, 2007, 08:02 PM
From memory you have to first create a blank emoty background movieclip inside the movieclip that the scrollbar is set to . then use actionscript to set its height/.width to that of all your xml content then finaly refresh the sidebar using _parent

basicly your xml movieclip has 0 width and height until you do the above and refresh the scrollbar , it works though tried it :D

Bill12
August 20th, 2007, 06:11 AM
RaymondP thanx for that but i only posted some lines of the hole code !! :)

I will make it more clearly, all the code with the XML is working fine except that when the "squares" that are the movie clips that attaches in the scrollPane are like buttons instead that are movie clips....
The main problem is that inside this movie clip i have buttons and are not functional with the scrollPane and i can`t make this buttons functional ...

Where is the non proper - action in the code ???
or how can i avoid the ScrollPane see the hole "sqaures" movie clips as buttons ?

Bill12
August 20th, 2007, 07:19 AM
Ok no problem it is solved !!!

Thanx for your help