Заставка с FXG в мобильных приложениях с Flash Builder для PHP - PullRequest
0 голосов
/ 03 июля 2011

Я хочу использовать актив .FXG в своем приложении для Android, которое я создаю с помощью Flash Builder для PHP.

В нем выдается сообщение об ошибке, в котором говорится, что мои активы. Класс MyResource не существует.

Неправильное имя класса {assets.MyResource}, указанное для атрибута SplashScreenImage

1 Ответ

1 голос
/ 19 июля 2011

ОК, основное внимание в вашем решении уделяется атрибуту preloader в мобильном приложении. Смотрите preloader = "CustomSplashScreen" ниже:

<?xml version="1.0" encoding="utf-8"?>
<s:ViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
    xmlns:s="library://ns.adobe.com/flex/spark" 
    firstView="views.FXGSplashHomeView" 
    preloader="CustomSplashScreen"
    splashScreenMinimumDisplayTime="3000"
    applicationDPI="160">
</s:ViewNavigatorApplication>

CustomSplashScreen расширяет и переопределяет класс spark.preloaders.SplashScreen и функцию getImageClass.

package 
{

    import mx.core.DPIClassification;
    import mx.core.mx_internal;

    import spark.preloaders.SplashScreen;

    use namespace mx_internal; 
    public class CustomSplashScreen extends SplashScreen 

    { 
        public function CustomSplashScreen() 
        { 
            super(); 
        } 

        override mx_internal function getImageClass(dpi:Number, aspectRatio:String):Class 
        { 
            return Class(splash);
        } 
    }
}

Всплеск в возвращаемом классе (splash), это простой файл fxg, например:

<?xml version="1.0" encoding="UTF-8"?>
<Graphic xmlns="http://ns.adobe.com/fxg/2008"
        xmlns:d="http://ns.adobe.com/fxg/2008/dt"
        xmlns:fc="http://ns.adobe.com/flashcatalyst/2009"
        version="2.0">
    <Path y="1" data="M 0 10 L 40 10 L 35 0 L 9 15 L 35 30 L 40 20 L 0 20 z">
        <fill>
            <SolidColor color="#0000FF" alpha="0.6"/>
        </fill>
    </Path>
</Graphic>

Это все, что нужно сделать. Веселись!

- Аллен

...