Hi,
I was wondering if someone could help me out. I really really need help. This is the only thing that holds my project back and I was supposed to deliver it yesterday.
I have a movie clip button with a dynamic text field inside. I am loading dynamically to the stage while a video is running in the background. I also have a fullscreen button (Flash component) on the stage. After clicking the fullscreen button and in Full_Screen mode the static buttons including the full screen button work without a problem, but the dynamic button seems not to work at all. Basically the dynamic button when clicked should change its message to “You have clicked button 1”. This works in normal mode, but not in Full screen.
I tried btn_cuePt_1.enabled= true; but without success.
Does it have something to do with not using the fullscreen events?
exp. stage.addEventListener(FullScreenEvent.FULL_SCREEN, fullScreenRedraw)
Thanks!!
This is the code of the fla:
import fl.video.*;
import fl.video.FLVPlaybackCaptioning;
import fl.video.FLVPlayback;
import fl.video.MetadataEvent;
import flash.events.Event;
import flash.net.URLLoader;
import flash.net.URLRequest;
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
//global variables
var btn_cuePt_1;
//file definitions
my_FLVPlybk.source="pets1.flv";
var xml_file= 'pets1.xml';
//load xml file
var loader:URLLoader=new URLLoader();
loader.addEventListener(Event.COMPLETE,completeHandler);
var request:URLRequest=new URLRequest(xml_file);
try{
loader.load(request);
}
catch(error:Error){
trace('Unable to load requested document.');
}
try{
loader.load(request);
}
catch(error:Error){
trace('Unable to load requested document.');
}
//load cuepoints
function completeHandler(event:Event):void{
var cuePt:Object = new Object(); //create cue point object
var loader:URLLoader=URLLoader(event.target);
var result:XML=new XML(loader.data);
var myXML:XMLDocument=new XMLDocument();
myXML.ignoreWhite=true;
myXML.parseXML(result.toXMLString());
var node=myXML.firstChild.childNodes;
for(var i:Number = 0; i < node.length; i++) {
cuePt.time=node*.attributes['begin'];
cuePt.track=node*.attributes['track'];
cuePt.end=node*.attributes['end'];
cuePt.button=node*.attributes['button'];
cuePt.vid=node*.attributes['vid'];
cuePt.type = "actionscript";
cuePt.name=node*.firstChild.nodeValue;
my_FLVPlybk.addASCuePoint(cuePt); //add AS cue point
}
}
full_btn.addEventListener(MouseEvent.CLICK,fullscreen_enable);
function fullscreen_enable():void{
stage.displayState = StageDisplayState.FULL_SCREEN;
btn_cuePt_1.mouseEnabled = true;
btn_cuePt_1.enabled = true;
}
my_FLVPlybk.addEventListener(MetadataEvent.CUE_POINT, call_cuePt);
function call_cuePt(evt:MetadataEvent):void {
var theID = setInterval(check_endtime, 5000);
function check_endtime():void{
if (getChildByName("btn_cuePt_1") != null){
removeChild(btn_cuePt_1);
}
clearInterval(theID);
}
if(evt.info.track>0){
if(evt.info.button==1){
btn_cuePt_1 = new btn_cuePt_1Class();
addChild(btn_cuePt_1);
btn_cuePt_1.name="btn_cuePt_1";
btn_cuePt_1.x = 316;
btn_cuePt_1.y = 27;
btn_cuePt_1.width = 110;
btn_cuePt_1.height = 60;
var tw2:Tween = new Tween(btn_cuePt_1, "width", Strong.easeIn, 0, 220, 20, false);
tw2.addEventListener(TweenEvent.MOTION_FINISH, tw2End);
function tw2End(event:Event):void {
btn_cuePt_1.my_ta.text=evt.info.name;
btn_cuePt_1.addEventListener(MouseEvent.MOUSE_DOWN, b1_onPress);
function b1_onPress(myEvent:MouseEvent){
btn_cuePt_1.my_ta.text="You have clicked button 1";
}//end b1_onPress
}//end tw2End
}//end (evt.info.button==1)
}//end (evt.info.track>0)
}
Here is the xml with the cue points that is being loaded
<?xml version="1.0" encoding="iso-8859-1"?>
<captions>
<p begin="003" end="008.50" vid="pets1-01amor.mp4" button="1" track="1">Que Amor</p>
<p begin="010" end="013.50" vid="pets1-02vontade.mp4" button="2" track="2">Fica à vontade</p>
<p begin="016" end="017.50" vid="pets1-03cade.mp4" button="1" track="3">Cadê</p>
<p begin="018" end="028.00" vid="pets1-04junior.mp4" button="2" track="4">Sandy & Junior</p>
<p begin="025" end="030.50" vid="pets1-05escolheram.mp4" button="1" track="5">elas que escolheram o nome</p>
<p begin="042" end="048.50" vid="pets1-06garotona.mp4" button="2" track="6">Garotona</p>
<p begin="050" end="055.50" vid="pets1-07carregando.mp4" button="1" track="7">Não vai te carregando</p>
<p begin="079" end="084.50" vid="pets1-08treinada.mp4" button="2" track="8">Ela é treinada?</p>
<p begin="083" end="088.50" vid="pets1-09nemnao.mp4" button="1" track="9">Ele nem teve muito trabalho não.</p>
<p begin="104" end="109.55" vid="pets1-10parecido.mp4" button="2" track="10">Parecido com ela</p>
<p begin="114" end="119.55" vid="pets1-11ndo.mp4" button="1" track="11">Convivendo, perdendo, acostumando</p>
</captions>