View Full Version : Flash button not work
geoffreymorelle
01-05-2007, 09:32 AM
Hello i have test to create a flash button to switch in fullscreen mode.
My button is a basic flash animation with 4 states, and no script.
My hotspot code is this
<?xml version="1.0" ?>
<hotspots >
<spot id="spot_1" static="1" url="bouton-in.swf" align="lb" staticAlign="lb" staticX="15" staticY="-15" onClick="fullscreen:index.html"/>
</hotspots>
The button is normaly active, but the script not work.
but if a change the button by a simple png file, it's work fine.
do you have an exemple of *.fla file ?
Thanks for your help
-Geo
geoffreymorelle
01-05-2007, 10:42 AM
I have make another test
the this is the code of the spots.xml
<?xml version="1.0" ?>
<hotspots controller="hotspots_lc">
<spot id="spot_1" static="1" url="bouton-in.swf" align="lb" staticAlign="lb" staticX="15" staticY="-15"/>
</hotspots>
ans this is the code of my actions script
// Use the same name in spots.xml: <hotspots controller="hotspots_lc">
// Better use different controller names for different panoramas
var controllerName = "hotspots_lc";
// Master slot name:
var masterSlot:String;
// Slave slot name:
var slaveSlot:String;
// Begin of connection code (better use it as is).
var dumpSlot = controllerName+"_dump_"+random(1000000);
var _lc = new LocalConnection();
_lc.allowDomain = function () {
return true; // allow all connections
}
_lc.connect(dumpSlot);
_lc.onStatus = function(info) {
if (info.level == "error") {
trace("No master connection detected.");
_lc.close();
delete _lc;
}
};
_lc.setSlot = function(slot) {
masterSlot = controllerName+"_master_"+slot;
slaveSlot = controllerName+"_slave_"+slot+"_"+random(1000000);
_lc.close();
_lc.connect(slaveSlot);
trace("set slave: "+slaveSlot);
startWatch();
};
_lc.send(controllerName+"_master_0", "getSlot", dumpSlot);
// end of connecion code
var panoName:String; // current pano name
var panoBusy:Boolean; // true if panorama is loading or a transition effect is in process
var iid:Number; // interval id
// start watching parameters "panoName" and "panoBusy":
function startWatch () {
iid = setInterval(this, "sendQuery", 500);
}
// send query:
function sendQuery () {
// 3rd argument is array of askable parameters, 4th and 5th are connection name and function to callback
_lc.send(masterSlot, "getParams", ["panoName","panoBusy"], slaveSlot, "callback");
}
// listener function:
_lc.callback = function(values) {
panoName = values[0];
panoBusy = values[1];
};
btnin._visible=false;
btnout.onRelease = function() {
this._visible = false;
btnin._visible=true;
_lc.send(masterSlot, "fullscreen", ["-"]);
};
btnin.onRelease = function() {
this._visible = false;
btnout._visible=true;
_lc.send(masterSlot, "fullscreen", ["-"]);
};
It's not work Too
thanks for your help
-Geo
Denis
01-05-2007, 11:54 AM
To make the script work with buttons you should compile this button as AS3 application (use free Flash 9 alpha, for example) http://labs.adobe.com/technologies/flash9as3preview/
I told in Hotspots Review if button is AS1-AS2 application, it blocks all mouse events for the Hotspot renderer.
Second example works ok for me (buttons are changing, functions are calling) except fullscreen mode; Flash Player security prevents the mode switching possible because the time lag between a mouse click and the fullscreen command, you need to call the fullscreen command directly (using Hotspots events) to avoid this bug.
geoffreymorelle
01-15-2007, 05:02 PM
Hello,
If i create a simple button to toggle fullscreen mode in AS3
This button is a movie in panorama flash player,
i think i dont want to use Local Connection.
but my question is simple what is the function to be call for send command to switch panorama in fullscreen ?
thanks
suastegui
01-16-2007, 07:03 AM
Hello,
If i create a simple button to toggle fullscreen mode in AS3
This button is a movie in panorama flash player,
i think i dont want to use Local Connection.
but my question is simple what is the function to be call for send command to switch panorama in fullscreen ?
thanks
Go here: http://www.adobe.com/devnet/flashplayer/articles/full_screen_mode.html
vBulletin® v3.7.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.