Hi,
I am trying to create my first plugin based on an swf and I am having trouble from the outset.
What I am initially trying to do is make a menu bar at the bottom of the screen and I want its width to scale to the size of the stage so that no matter what width the pano is viewed in (including full screen) it will always be the full width of the pano.
I have created a basic swf with a grey square 80 x 80.
I have applied the following code:
import krpano_as3_interface;
if (stage == null){
// plugin startup
addEventListener(Event.ADDED_TO_STAGE, startplugin);
//addEventListener(Event.REMOVED_FROM_STAGE, stopplugin);
}
var krpano : krpano_as3_interface = null;
function startplugin(event:Event):void{
krpano = krpano_as3_interface.getInstance();
gb_mc.width = stage.stageWidth;
}
Display More
It sort of works but it does not seem to go 100% across and I am also finding it difficult to position it using the xml, see below:
<plugin
name="menu"
url="%SWFPATH%menu360.swf"
keep="true"
visible="true"
enabled="true"
handcursor="false"
capture="false"
zorder="1"
alpha="1.00"
blendmode="normal"
smoothing="true"
align="leftbottom"
edge="center"
x="0" y="0"
rotate="0"
width="" height=""
scale="1.0"
scale9grid=""
crop=""
mask=""
onloaded=""
onover="action(menu_show);"
onhover=""
onout="action(menu_hide);"
ondown=""
onup=""
onclick=""
/>
Display More
I can tweak it using the x and y values but that would change when I scale the pano, wouldn't it?
I think I'm going to have a lot more questions around this but if anyone can help with this one I'd appreciate it.
Thanks.
T12