0

I'm trying to set image source conditionaly using the following line:

source="{data.muted ? '/assets/audioMuted.gif' : '/assets/audio.gif'}"

Apps run fine when run from Flex builder, but when I try to export release build from Flex builder, those gif files are not exported.

Does anybody have an idea what to do in this case.

Josh
  • 10,961
  • 11
  • 65
  • 108
Marko
  • 30,263
  • 18
  • 74
  • 108

1 Answers1

2

You need to embed the assets. Flexbuilder will never add an image to your swf unless you Embed it. If you looked at a tool such as fiddler to see what called your app is making you'd see one of those images being called and you can't have placed them into an appropriate folder.

[Embed("/assets/picture.gif")]
private const IMAGE1:Class;
[Embed("/assets/picture2.gif")]
private const IMAGE2:Class;

then you would do

source="{data.muted ? IMAGE1: IMAGE2 }"

that should do as long as the embed path is correct (flexbuilder will tell you if it isn't).

kenneth
  • 1,055
  • 1
  • 8
  • 15