PDA

Просмотр полной версии : Чото у меня примеры их HELP не работают


processor
16.01.2008, 02:36
Все примеры больше 5-6 строк перетаскиваю просто из хелпа в Action окно и выдают ошибки всяческие. Как так...

Вот например из Panning and Scrolling display objects:

import flash.events.MouseEvent;
import flash.geom.Rectangle;

// Define the initial viewable area of the TextField instance:
// left: 0, top: 0, width: TextField's width, height: 350 pixels.
bigText.scrollRect = new Rectangle(0, 0, bigText.width, 350);

// Cache the TextField as a bitmap to improve performance.
bigText.cacheAsBitmap = true;

// called when the "up" button is clicked
function scrollUp(event:MouseEvent):void
{
// Get access to the current scroll rectangle.
var rect:Rectangle = bigText.scrollRect;
// Decrease the y value of the rectangle by 20, effectively
// shifting the rectangle down by 20 pixels.
rect.y -= 20;
// Reassign the rectangle to the TextField to "apply" the change.
bigText.scrollRect = rect;
}

// called when the "down" button is clicked
function scrollDown(event:MouseEvent):void
{
// Get access to the current scroll rectangle.
var rect:Rectangle = bigText.scrollRect;
// Increase the y value of the rectangle by 20, effectively
// shifting the rectangle up by 20 pixels.
rect.y += 20;
// Reassign the rectangle to the TextField to "apply" the change.
bigText.scrollRect = rect;
}

up.addEventListener(MouseEvent.CLICK, scrollUp);
down.addEventListener(MouseEvent.CLICK, scrollDown);

_____________

Выдает что штук 10 ошибок 1120
Access of undefined property bigText

Вместо BigText еще есть up , down

И так почти все примеры.

me2
16.01.2008, 03:17
Вобщето это не полный список, тут же нет инициализации объекта, но есть куча установок к нему. конешно будет ругаться.
и нафига ты их в action панель перетаскиваешь? Делай рутовый клас и вперёд

etc
16.01.2008, 10:09
processor, вы уже получили один плюс за неоформленный код, вы хотите получить следующий? Оформляйте код.

Читайте документацию внимательно, а не бездумно копируйте код.