Hi all,
I am new to Flash and AS-3.0. I am using Flash-CS3 as IDE and AS3 for programming/coding.
I have created a ScrollPane component using the following AS3 code, which is a sample user-defined function written in ActionScript 3.0:
var sp:ScrollPane = new ScrollPane();
var myClip:MovieClip;
var boxXLoc:int = 0;
var boxYLoc:int = 0;
var boxWidth:int = **[U]140[/U]**;
var boxHeight:int = 300;
function newScrollPane():void {
number1=myClip.numChildren;
var boxFillColor03:uint = 0xFFFFCC;
myClip.graphics.beginFill(boxFillColor03);
myClip.graphics.drawRect(boxXLoc, boxYLoc, boxWidth, boxHeight); //(0,0,140,300)
myClip.graphics.endFill();
myClip.buttonMode = false;
trace("myClip.getBounds(myClip)"+myClip.getBounds(myClip));
stage.frameRate = 31;
createScrollPane();
function createScrollPane():void {
sp.move(418,155);
// sp.setSize(190,280);
sp.setSize(**[U]145[/U]**,200);
sp.source=myClip; //Here myClip is assigned to ScrollPane instance
sp.scrollDrag = false;
sp.drawFocus(true);
sp.horizontalScrollBar.visible=false;
addChild(sp);
}
}
The code inside the function works well within my main application when called.
The ScrollPane created is visible(with both Vertical and Horizontal Scrollbars) at perfect pixel-positions(on the stage) which I have mentioned in the above code, which works well till this point as of my requirement.
But, I don't want to make visible the Horizontal ScrollBar. Instead, it should be invisible.
**I had tried by changing the values of width of ScrollPane[i.e., first parameter in sp.setSize() method in the above code,which is in BOLD face with underlined] and the value of the instance "boxWidth", [i.e., which denotes the "myClip"(MovieClip) width property, which is in BOLD face with underlined] respectively. ** But, it is always visible.
So, What is the necesary/required code which is to be added to the above code?
(OR)
What are the changes I need to do in the above code to solve this issue?
Please, anyone help me regarding this. I request you to spend few seconds of your time in posting the correct solution to my problem.
Waiting for your repliesā¦
Thanks in advanceā¦
Srihari.Ch