problem z przewijaną treścią
: sob paź 23, 2010 1:41 pm
Problem mój polega na tym, że generalnie nie znam się na flashu 
Użyłam menu i tam były jakieś skrypty w AS2 a potem chciałam dodać przewijaną treść w oknie (tekst i obrazki), gdzie skrypty pisane były w AS3.
Przypuszczalnie z tego powodu wywala mi takie błędy:
The class or interface 'MouseEvent' could not be loaded. function scrollDraggerPress(event:MouseEvent):void {
The class or interface 'Rectangle' could not be loaded. var bounds:Rectangle = new Rectangle(leftBound, topBound, 0, bottomBound);
The class or interface 'MouseEvent' could not be loaded. function reportStageMouse(event:MouseEvent):void {
The class or interface 'MouseEvent' could not be loaded. function mouseUpOnStage(event:MouseEvent):void {
Pojawia mi się okno z paskiem do przewijania ale pasek się nie przewija
Co zrobić? A to jest cały skrypt:
Użyłam menu i tam były jakieś skrypty w AS2 a potem chciałam dodać przewijaną treść w oknie (tekst i obrazki), gdzie skrypty pisane były w AS3.
Przypuszczalnie z tego powodu wywala mi takie błędy:
The class or interface 'MouseEvent' could not be loaded. function scrollDraggerPress(event:MouseEvent):void {
The class or interface 'Rectangle' could not be loaded. var bounds:Rectangle = new Rectangle(leftBound, topBound, 0, bottomBound);
The class or interface 'MouseEvent' could not be loaded. function reportStageMouse(event:MouseEvent):void {
The class or interface 'MouseEvent' could not be loaded. function mouseUpOnStage(event:MouseEvent):void {
Pojawia mi się okno z paskiem do przewijania ale pasek się nie przewija
Co zrobić? A to jest cały skrypt:
Kod: Zaznacz cały
// Scroll My Content function - AS3
function scrollMyContent () {
// Cache the TextField as a bitmap to improve performance.
content_mc.cacheAsBitmap = true;
// Event Listeners
scrollDragger.addEventListener(MouseEvent.MOUSE_DOWN, scrollDraggerPress);
stage.addEventListener(MouseEvent.MOUSE_UP, mouseUpOnStage);
// Set variables
var scrollbarHeight:Number = scrollbarBG.height;
var contentHeight:Number = content_mc.height;
var scrollDraggerHeight:Number = scrollDragger.height;
var maskHeight:Number = contentMask.height;
var scrollAmout:Number = (contentHeight-maskHeight)/(scrollbarHeight-scrollDraggerHeight);
var topBound:Number = scrollbarBG.y;
var bottomBound:Number = scrollbarBG.height-scrollDraggerHeight+scrollbarBG.y;
var startPos:Number = content_mc.y;
var leftBound:Number = scrollbarBG.x;
var absNumSet:Number = 0;
// When scrollDragger gets pressed we do this
function scrollDraggerPress(event:MouseEvent):void {
// Set bounds using some of the scroller BG properties claimed above
var bounds:Rectangle = new Rectangle(leftBound, topBound, 0, bottomBound);
scrollDragger.startDrag(false, bounds);
stage.addEventListener(MouseEvent.MOUSE_MOVE, reportStageMouse);
function reportStageMouse(event:MouseEvent):void {
absNumSet = Math.abs(scrollbarBG.y - scrollDragger.y);
content_mc.y = Math.round(absNumSet * - 1 * scrollAmout + startPos);
}
}
// When mouse is released while dragging we do this
function mouseUpOnStage(event:MouseEvent):void {
stopDrag();
}
}
scrollMyContent();