You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by chris_d_k <ck...@christiankiefer.de> on 2016/04/15 20:21:13 UTC

Build Flex Mobile Apps with different Assets

Hi,

I have a flex mobile app. 

I want to compile it to different apps which should use a lot of different
embedded fxg-Files. 
When I put all the fxg files the app would be really huge and full of assets
it does not need...

What is the best way to achive this? Is there an article on this topic I
haven't found?

I have read the flex team created an FXG-Runtume-Parser but haven't found
it... with this I think I could store the fxg-Files in locales...

Or would it be better to create an asset-swc for every app with different
assets and some methods to acces them (f.e.
getTYPEAImages():SpriteVisualElement, getTYPEBImages():SpriteVisualElement,
...)?





--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Build-Flex-Mobile-Apps-with-different-Assets-tp12471.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Build Flex Mobile Apps with different Assets

Posted by OmPrakash Muppirala <bi...@gmail.com>.
In the past, I have created a swf file per fxg and loaded it at runtime.
You will need to write a tool that creates a small snippet of code for each
fxg that gets compiled into a swf.  At runtime, simply load the swf via a
loader call and you have your fxg.

If you can batch the fxgs into groups, you might want to create one swf per
group, so folks dont have to download them individually which might cause
quite a bit of network traffic.

Thanks,
Om

On Fri, Apr 15, 2016 at 2:06 PM, chris_d_k <ck...@christiankiefer.de> wrote:

> I know it at compile time... But there will be a few hundred different
> assets
> used per app... and an increasing number of apps...
>
> So I am searching for something to to configure which assets are used
> without including all in the swf/mobile app...
>
>
>
> --
> View this message in context:
> http://apache-flex-users.2333346.n4.nabble.com/Build-Flex-Mobile-Apps-with-different-Assets-tp12471p12474.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>

Re: Build Flex Mobile Apps with different Assets

Posted by Evyatar Ben Halevi-Arbib <ev...@gmail.com>.
You can use compiler flags for embedding different images.
We use it for adding different logic to Web vs. Mobile applications for
example.

Good luck,
Evyatar
בתאריך 16 באפר 2016 00:38,‏ "chris_d_k" <ck...@christiankiefer.de> כתב:

> I know it at compile time... But there will be a few hundred different
> assets
> used per app... and an increasing number of apps...
>
> So I am searching for something to to configure which assets are used
> without including all in the swf/mobile app...
>
>
>
> --
> View this message in context:
> http://apache-flex-users.2333346.n4.nabble.com/Build-Flex-Mobile-Apps-with-different-Assets-tp12471p12474.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>

Re: Build Flex Mobile Apps with different Assets

Posted by chris_d_k <ck...@christiankiefer.de>.
I know it at compile time... But there will be a few hundred different assets
used per app... and an increasing number of apps... 

So I am searching for something to to configure which assets are used
without including all in the swf/mobile app... 



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Build-Flex-Mobile-Apps-with-different-Assets-tp12471p12474.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Build Flex Mobile Apps with different Assets

Posted by Alex Harui <ah...@adobe.com>.
Style modules are another possibility.

On 4/15/16, 12:05 PM, "omuppi1@gmail.com on behalf of OmPrakash Muppirala"
<omuppi1@gmail.com on behalf of bigosmallm@gmail.com> wrote:

>Do you know what assets would be used during compile time?  Or will it be
>determined at runtime.
>
>If you know it in compile time, you can just reference them in code like a
>normal class and the compiler will include it in the swf/mobile app.
>
>
>On Fri, Apr 15, 2016 at 11:21 AM, chris_d_k <ck...@christiankiefer.de> wrote:
>
>> Hi,
>>
>> I have a flex mobile app.
>>
>> I want to compile it to different apps which should use a lot of
>>different
>> embedded fxg-Files.
>> When I put all the fxg files the app would be really huge and full of
>> assets
>> it does not need...
>>
>> What is the best way to achive this? Is there an article on this topic I
>> haven't found?
>>
>> I have read the flex team created an FXG-Runtume-Parser but haven't
>>found
>> it... with this I think I could store the fxg-Files in locales...
>>
>> Or would it be better to create an asset-swc for every app with
>>different
>> assets and some methods to acces them (f.e.
>> getTYPEAImages():SpriteVisualElement,
>>getTYPEBImages():SpriteVisualElement,
>> ...)?
>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> 
>>http://apache-flex-users.2333346.n4.nabble.com/Build-Flex-Mobile-Apps-wit
>>h-different-Assets-tp12471.html
>> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>>


Re: Build Flex Mobile Apps with different Assets

Posted by OmPrakash Muppirala <bi...@gmail.com>.
Do you know what assets would be used during compile time?  Or will it be
determined at runtime.

If you know it in compile time, you can just reference them in code like a
normal class and the compiler will include it in the swf/mobile app.


On Fri, Apr 15, 2016 at 11:21 AM, chris_d_k <ck...@christiankiefer.de> wrote:

> Hi,
>
> I have a flex mobile app.
>
> I want to compile it to different apps which should use a lot of different
> embedded fxg-Files.
> When I put all the fxg files the app would be really huge and full of
> assets
> it does not need...
>
> What is the best way to achive this? Is there an article on this topic I
> haven't found?
>
> I have read the flex team created an FXG-Runtume-Parser but haven't found
> it... with this I think I could store the fxg-Files in locales...
>
> Or would it be better to create an asset-swc for every app with different
> assets and some methods to acces them (f.e.
> getTYPEAImages():SpriteVisualElement, getTYPEBImages():SpriteVisualElement,
> ...)?
>
>
>
>
>
> --
> View this message in context:
> http://apache-flex-users.2333346.n4.nabble.com/Build-Flex-Mobile-Apps-with-different-Assets-tp12471.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>

Re: Build Flex Mobile Apps with different Assets

Posted by Evyatar Ben Halevi-Arbib <ev...@gmail.com>.
This solution is consisted of two parts (in this example I divide to "web"
and "tablet" applications)

1. Have in the compiler settings "Additional compiler arguments" as follows
(for "web" application) -
-define=CONFIG::tablet,false
-define=CONFIG::web,true
(This is defined locally in Flash Builder, but can be defined also via Ant
build etc.)

2. In the code itself wrap relevant code sections with compilation flags as
follows -
CONFIG::web
{
private const initState:String = "webValue";
}
CONFIG::tablet
{
private const initState:String = "tabletValue";
}

In the above example you would have a const definition with different value
for web and tablet applications.

Good luck,
Evyatar

On Tue, Apr 19, 2016 at 1:51 PM, chris_d_k <ck...@christiankiefer.de> wrote:

> Hello Evyatar, Hello GhaziTriki,
>
> do you have an example how you realized it?
>
>
>
>
>
> --
> View this message in context:
> http://apache-flex-users.2333346.n4.nabble.com/Build-Flex-Mobile-Apps-with-different-Assets-tp12471p12527.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>

Re: Build Flex Mobile Apps with different Assets

Posted by chris_d_k <ck...@christiankiefer.de>.
Hello Evyatar, Hello GhaziTriki,

do you have an example how you realized it?





--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Build-Flex-Mobile-Apps-with-different-Assets-tp12471p12527.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Build Flex Mobile Apps with different Assets

Posted by GhaziTriki <gh...@gmail.com>.
Hello,

Another solution would be using compiler arguments. I have done it for some
applications and it works well.



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Build-Flex-Mobile-Apps-with-different-Assets-tp12471p12494.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Build Flex Mobile Apps with different Assets

Posted by Nemi <ne...@gmail.com>.
Use ANT script per app you want to build.

Organize that "additional" (in your case only assets) source files paths
like:
app1/src/MyAssets.as
app2/src/MyAssets.as
app3/src/MyAssets.as
...
and move them outside main src source files path.

In ANT build scripts include proper assets source files.

If you use same name asset constants in each app, but they look different,
this solution is enough, and it will be strong typed, as each app will look
for same named assets in MyAssets.as, and you use them like:
myBitmapImage.source = MyAssets.BLUE_CIRCLE_CLASS

But if there are different number or names of assets in MyAssets, then you
can create 
funtion getAssetByName(assetName:String) 
to load asset in app.

For better organization (and development speed) try to have each MyAssets in
different SWC. If you manage to do that, then include SWC as library and not
source paths in your build scripts.



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Build-Flex-Mobile-Apps-with-different-Assets-tp12471p12587.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.