Page 1 of 1

Accessing attributes of pano loaded with MXML SWFLoader

Posted: Tue Jul 10, 2012 8:00 pm
Hi, I'm having a heck of time getting data back out from my pano.

The project is in Flash Builder 4.5 and I've used the following code to create an MXML component that displays the pano .swf file. The pano behaves well and it's hotspots load other panos into the window when clicked. What I cannot seem to do, however, is access info from the pano currently being displayed. The 'photoClicked' function should pull key bits back from the pano to feed to the 'saveViewInfo' function but running through all the attributes of the SWFLoader hasn't yielded any fruit.

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<s:BorderContainer xmlns:fx=""
				   width="550" height="530" backgroundColor="#959595" chromeColor="#808080">
			import mx.controls.Alert;
			protected function photoClicked(e:MouseEvent):void {
				// Here is where I need to access info from the pano,
				var pan:Number = 0;
				var tilt:Number = 0;
				var fov:Number = 0;
				var swf:String = ''; // Should show name of currently displayed pano if user has moved into a different room than the original source.
			protected function saveViewInfo(pan:Number,tilt:Number,fov:Number,swf:String):void {
				// TODO: Function stub
			protected function loaded(e:Event):void {
				loader.height = 350;
				loader.width = 525;}
	<s:Panel left="10" right="10" top="10" bottom="10" backgroundColor="#808080"
			 chromeColor="#808080" fontSize="20" title="Scene View">
		<s:Label x="29" bottom="24" color="#970000" fontSize="12" text="Shift to Zoom In - Ctrl to Zoom Out"/>
		<s:HGroup right="30" bottom="20" height="20" gap="5" verticalAlign="middle">
			<s:Button id="btnTakePhoto" height="20" label="Capture Photo" 
					  chromeColor="#80FF80" color="#000000" cornerRadius="10"
					  fontFamily="Arial" fontSize="14" fontWeight="normal"
			<s:Button id="btnTakeEvidence" height="20" label="Collect Evidence"
					  chromeColor="#80FF80" color="#000000" cornerRadius="10"
					  fontFamily="Arial" fontSize="14" fontWeight="normal"/>
		<s:SWFLoader id="loader" horizontalCenter="-1" top="0" autoLoad="true"
					 scaleContent="true" maintainAspectRatio="false" maintainProjectionCenter="false"
					 source="nfstc/panos/Cafe_1_sm_out.swf" complete="loaded(event)"/>

Re: Accessing attributes of pano loaded with MXML SWFLoader

Posted: Tue Jul 10, 2012 8:05 pm
Here's a shot of the component in the Design View mode of Flash Builder

Here's the whole application running in a browser...