Question

Code:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" backgroundColor="0xFFCCFF">
    <s:Image source="@Embed(source='untitled.png')" x="0" y="0" width="50" height="50" />
</s:Application>

This image is not showing. Wth? The project is building, and I changed the Application's backgroundColor attribute just to confirm that. Originally this was with a jpg in another folder within the project's directory, but outside the source code directory. Thanks.

EDIT:

When I change the code to this:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" backgroundColor="0xFFCCFF" width="300" height="300">
    <s:Button x="0" y="0"  width="50" height="50" />
    <!--<s:Image source="@Embed(source='untitled.png')" x="0" y="0" width="50" height="50" />-->
</s:Application>

the Button won't show either. I'm using FlashDevelop, which I just installed. Is something wrong with my IDE or something?

EDIT:

I'm apparently able to get stuff to show up just fine in MX and Flex 3; it's when I use Spark and Flex 4 that this is happening. But I'm running this in Flash Player 11.8, so I don't see why Spark would just be dead in the water like that, or why it would be able to load a background color but not much else.

Était-ce utile?

La solution

Apparently it's a bug in FlashDevelop. I'm running FlashDevelop 4.4.2 RTM, and when I created this and a couple of off-to-the-side projects for Spark, I selected Flex 4 as the type of project I wanted to create. The Spark code would be auto-generated just fine, but it was defaulting the project to compile for Flash Player 10.1, not 11.1. Spark depends on 11+ (accounting for future versions). I guess I'll just post this answer and maybe file a bug report or something.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top