Thanks Stephen, I figured out the problem, but not a solution yet. It’s the skinClass for the background image, so for instance if you take out the skinClass in the index file the away classes will show.
I came across this post that talks about changing the z-index of the parent, but couldn’t make it work. Would that be a possibility?
Here’s the code I’m working with, edited a bit for simplicity.
Index.mxml
<?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"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:skins="skins.*"
xmlns:components="components.*"
backgroundAlpha="0"
width="100%" height="100%" autoLayout="true" currentState="home"
viewSourceURL="srcview/index.html"
creationComplete="init()"
skinClass="skins.MyAppSkin">
<s:states>
<s:State name="home" />
</s:states>
<fx:Style source="assets\\\\\\\\\\\\\\\\css\\\\\\\\\\\\\\\\style.css"/>
<fx:Script>
<![CDATA[
import mx.core.ScrollPolicy;
import skins.MyAppSkin;
import spark.skins.spark.ApplicationSkin;
private function init():void{
cone_cont.visible = true;
cone_cont.start();
}
]]>
</fx:Script>
<components:home id="home_comp"
includeIn="home"
backgroundAlpha="0"/>
<components:main_cont_away3d_cone backgroundAlpha="0"
id="cone_cont"
visible="false"/>
</s:Application>
MyAppSkin
<?xml version="1.0" encoding="utf-8"?>
<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:fb="http://ns.adobe.com/flashbuilder/2009"
xmlns:mx="library://ns.adobe.com/flex/mx">
<fx:Metadata>
<![CDATA[
/**
* A strongly typed property that references the component to which this skin is applied.
*/
[HostComponent("spark.components.Application")]
]]>
</fx:Metadata>
<fx:Script fb:purpose="styling">
<![CDATA[
import mx.core.ScrollPolicy;
import mx.graphics.BitmapFill;
import mx.graphics.BitmapFillMode;
[Embed("assets/view/Background_Scene_Image.png")]
protected const BG_FILL:Class;
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
var bmpFill:BitmapFill = new BitmapFill();
bmpFill.source = BG_FILL;
bmpFill.fillMode = BitmapFillMode.SCALE;
backgroundRect.fill = bmpFill;
super.updateDisplayList(unscaledWidth, unscaledHeight);
}
]]>
</fx:Script>
<s:states>
<s:State name="normal"/>
<s:State name="disabled"/>
</s:states>
<s:Rect id="backgroundRect" left="0" right="0" top="0" bottom="0">
<s:fill>
<!--- @private -->
<s:SolidColor id="bgRectFill" color="#FFFFFF"/>
</s:fill>
</s:Rect>
<s:Group left="0" right="0" top="0" bottom="0">
<s:layout>
<s:VerticalLayout gap="0" horizontalAlign="justify" />
</s:layout>
<s:Scroller id="scroller"
width="100%"
height="100%">
<s:Group id="contentGroup"
left="0"
right="0"
top="0"
bottom="0"
width="100%"
height="100%"
clipAndEnableScrolling="true"
contentBackgroundAlpha="0"/>
</s:Scroller>
</s:Group>
</s:Skin>
main_cont_away3d_cone.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:BorderContainer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
backgroundAlpha="0"
width="100%"
height="100%">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
<![CDATA[
import plz.Away3D4AFP11_ConePrimitive;
public function start():void{
var cap:Away3D4AFP11_ConePrimitive = new Away3D4AFP11_ConePrimitive();
cap.x = 0;
cap.y = 0;
window.addChild(cap);
}
]]>
</fx:Script>
<s:SpriteVisualElement id="window"
width="100%"
height="100%"/>
</s:BorderContainer>