Action Script 3 TextArea Component в Adobe Animate - PullRequest
0 голосов
/ 15 апреля 2020

Мне нужно TextField с прокруткой. Я нашел пример: https://help.adobe.com/ru_RU/FlashPlatform/reference/actionscript/3/fl/controls/TextArea.html#htmlText

Первая ошибка была fl.controls не найдена. Я добавил папку "d: \ Program Files \ Adobe \ Adobe Animate 2020 \ Common \ Configuration \ Source \ Component Source \ ActionScript 3.0 \ User Interface \" в качестве источника.

После этого, если я запустил пример:

import fl.controls.TextArea;

var myText:String = "";
myText += "<p>You can use the <b> tag to create <b>bold</b> text.</p>";
myText += "<p>You can use the <i> tag to create <i>italic</i> text.</p>";
myText += "<p>You can use the <u> tag to create <u>underlined</a> text.</p>";
myText += "<p>You can use the <a> tag to create <a href='http://www.adobe.com'>links to other sites</a>.</p>";
myText += "<p>You can use the <br> tag to create<br>new lines of text<br>whenever you want.</p>";
myText += "<p>You can use the <font> tag to specificy different font <font color='#FF0000'>colors</font>, <font size='16'>sizes</font>, or <font face='Times New Roman'>faces</font>.</p>";
myText += "<p>You can use the <img> tag to load images or SWF files:<br><img src='http://www.helpexamples.com/flash/images/logo.png'>.</p>";

var myTextArea:TextArea = new TextArea();
myTextArea.htmlText = myText;
myTextArea.setSize(320, 100);
myTextArea.move(10, 10);
addChild(myTextArea);

Я получаю: TypeError: Error #1009: Cannot access a property or method of a null object reference. at fl.controls::TextArea/drawLayout() at fl.controls::TextArea/draw() at fl.core::UIComponent/callLaterDispatcher() TypeError: Error #2007: Parameter child must be non-null. at flash.display::DisplayObjectContainer/addChildAt() at fl.controls::BaseButton/drawBackground() at fl.controls::BaseButton/draw() at fl.core::UIComponent/drawNow() at fl.controls::ScrollBar/draw() at fl.controls::UIScrollBar/draw() at fl.core::UIComponent/callLaterDispatcher() TypeError: Error #2007: Parameter child must be non-null. at flash.display::DisplayObjectContainer/addChildAt() at fl.controls::BaseButton/drawBackground() at fl.controls::BaseButton/draw() at fl.core::UIComponent/callLaterDispatcher() TypeError: Error #2007: Parameter child must be non-null. at flash.display::DisplayObjectContainer/addChildAt() at fl.controls::BaseButton/drawBackground() at fl.controls::LabelButton/draw() at fl.core::UIComponent/callLaterDispatcher() TypeError: Error #2007: Parameter child must be non-null. at flash.display::DisplayObjectContainer/addChildAt() at fl.controls::BaseButton/drawBackground() at fl.controls::BaseButton/draw() at fl.core::UIComponent/callLaterDispatcher() TypeError: Error #2007: Parameter child must be non-null. at flash.display::DisplayObjectContainer/addChildAt() at fl.controls::BaseButton/drawBackground() at fl.controls::BaseButton/draw() at fl.core::UIComponent/callLaterDispatcher() TypeError: Error #2007: Parameter child must be non-null. at flash.display::DisplayObjectContainer/addChildAt() at fl.controls::BaseButton/drawBackground() at fl.controls::BaseButton/draw() at fl.core::UIComponent/drawNow() at fl.controls::ScrollBar/draw() at fl.controls::UIScrollBar/draw() at fl.core::UIComponent/callLaterDispatcher() TypeError: Error #2007: Parameter child must be non-null. at flash.display::DisplayObjectContainer/addChildAt() at fl.controls::BaseButton/drawBackground() at fl.controls::BaseButton/draw() at fl.core::UIComponent/callLaterDispatcher() TypeError: Error #2007: Parameter child must be non-null. at flash.display::DisplayObjectContainer/addChildAt() at fl.controls::BaseButton/drawBackground() at fl.controls::LabelButton/draw() at fl.core::UIComponent/callLaterDispatcher() TypeError: Error #2007: Parameter child must be non-null. at flash.display::DisplayObjectContainer/addChildAt() at fl.controls::BaseButton/drawBackground() at fl.controls::BaseButton/draw() at fl.core::UIComponent/callLaterDispatcher() TypeError: Error #2007: Parameter child must be non-null. at flash.display::DisplayObjectContainer/addChildAt() at fl.controls::BaseButton/drawBackground() at fl.controls::BaseButton/draw() at fl.core::UIComponent/callLaterDispatcher()

После некоторого расследования я ve foundthat in drawLayout () of TextArea.as: background is null. It's because previous drawBackground () wants to find "upSkin". In defaultStyles` upSkin - "TextArea_upSkin". Похоже, мне нужен также графический файл c.

"d: \ Program Files \ Adobe \ Adobe Animate 2020 \ Common \ Configuration \ Source Component \ ActionScript 3.0 \ User Interface \ ComponentShim.fla" в той же папке не помогло.

...