yuhengh / starling-builder-engine

Other
19 stars 6 forks source link

ReferenceError: Error #1065: Variable Button is not defined. #1

Open pedrosimao opened 7 years ago

pedrosimao commented 7 years ago

Hello, I am trying to use a layout I created with Starling Builder inside my project. When I compile and run I get the following error.

ReferenceError: Error #1065: Variable Button is not defined. at global/flash.utils::getDefinitionByName() at starlingbuilder.engine::UIElementFactory/create()[/Users/Pedro/Top Documents/xxxPROGRAMMINGxxx/FLASH/ListenNMatch/src/starlingbuilder/engine/UIElementFactory.as:179] at starlingbuilder.engine::UIBuilder/loadTree()[/Users/Pedro/Top Documents/xxxPROGRAMMINGxxx/FLASH/ListenNMatch/src/starlingbuilder/engine/UIBuilder.as:145] at starlingbuilder.engine::UIBuilder/loadTree()[/Users/Pedro/Top Documents/xxxPROGRAMMINGxxx/FLASH/ListenNMatch/src/starlingbuilder/engine/UIBuilder.as:159] at starlingbuilder.engine::UIBuilder/load()[/Users/Pedro/Top Documents/xxxPROGRAMMINGxxx/FLASH/ListenNMatch/src/starlingbuilder/engine/UIBuilder.as:130] at starlingbuilder.engine::UIBuilder/create()[/Users/Pedro/Top Documents/xxxPROGRAMMINGxxx/FLASH/ListenNMatch/src/starlingbuilder/engine/UIBuilder.as:474] at net.pedrosimao.listennmatch.screens::AnchorLayoutTest()[/Users/Pedro/Top Documents/xxxPROGRAMMINGxxx/FLASH/ListenNMatch/src/net/pedrosimao/listennmatch/screens/AnchorLayoutTest.as:20] at net.pedrosimao.listennmatch.screens::MainScreen/createAnchorLayoutTest()[/Users/Pedro/Top Documents/xxxPROGRAMMINGxxx/FLASH/ListenNMatch/src/net/pedrosimao/listennmatch/screens/MainScreen.as:186]

I suspect the error is generated on the line 156 of UIBuilder.as: if (!_forEditor && item.customParams && item.customParams.forEditor)

Since my IDE says that ".forEditor" is an unresolved Variable.

Any ideas into what is going on?

Regards,

yuhengh commented 7 years ago

Hi,

It's a known issue. Reason and solution are in the faq page: http://wiki.starling-framework.org/builder/faq#why_am_i_getting_this_error_error_1065variable_some_class_name_is_not_defined

pedrosimao commented 7 years ago

Hey, thanks a lot. Adding public static const linkers:Array = [Button]; to my Class did the trick!