Copy link to clipboard
Copied
I have a clip inside another clip that I am trying to access a button from to load an external page (pop-up) and receive the 1120 Access of defined property error.
my ac3 code is located in my main (top level) clip as follows :
TiaraFrames_mc.TSofaQAFrm_btn.addEventListener(MouseEvent.CLICK,TSofaQAFrm);
function TSofaQAFrm(event:MouseEvent){
var TSofaQAFrmURL:String="TSofaQA.html";
var TSofaQAFrmWindow:String="newwindow";
var TSofaQAFrmFeatures:String="width=630, height=915, left=100, top=100, toolbar=0, location=0, menubar=0, toolbar=0, status=o, scrollbars=1";
ExternalInterface.call("openwindow", TSofaQAFrmURL, TSofaQAFrmWindow, TSofaQAFrmFeatures);
}
The error I receive is:
Scene 1, Layer 'Actions', Frame 1, Line 15 1120: Access of undefined property TiaraFrames_mc
I have checked and rechecked my naming and it all seems good.
I originally had the code in the imbedded clip however I don't believe the "Externalinterface.call" can be used from that location. Is that correct?
I have had success with this in other files where the button is located in the main clip.
Thanks
Paul
externalinterface can't be used in the flash test environment. your swf must be embedded in a container html page. externalinterface allows communication between that container html page and your swf.
p.s. please mark helpful/correct responses.
Copy link to clipboard
Copied
click file/publish settings/flash and tick "permit debugging". retest the following:
trace(TiaraFrames_mc.name);
trace(TiaraFrames_mc.TsofaQAFrm_btn.name);
TiaraFrames_mc.TSofaQAFrm_btn.addEventListener(MouseEvent.CLICK,TSofaQ AFrm);
function TSofaQAFrm(event:MouseEvent){
var TSofaQAFrmURL:String="TSofaQA.html";
var TSofaQAFrmWindow:String="newwindow";
var TSofaQAFrmFeatures:String="width=630, height=915, left=100, top=100, toolbar=0, location=0, menubar=0, toolbar=0, status=o, scrollbars=1";
ExternalInterface.call("openwindow", TSofaQAFrmURL, TSofaQAFrmWindow, TSofaQAFrmFeatures);
}
copy and paste the output including error message. indicate the line of code mentioned in the error message.
Copy link to clipboard
Copied
Thanks kglad,
That showed me I hadn't given TiaraFrames_mc an instance name. Once I did that got rid of the "1120: Access of undefined property error" however the button still won't work.
I get no errors testing the move however when I run Debug Movie and click on the button I get this:
Error: Error #2067: The ExternalInterface is not available in this container. ExternalInterface requires Internet Explorer ActiveX, Firefox, Mozilla 1.7.5 and greater, or other browsers that support NPRuntime.
at Error$/throwError()
at flash.external::ExternalInterface$/call()
at FrameStylesB_011211_fla::MainTimeline/TSofaQAFrm()[FrameStylesB_011211_fla.MainTimeline::frame1:23]
Cannot display source code at this location.
Thoughts?
Copy link to clipboard
Copied
externalinterface can't be used in the flash test environment. your swf must be embedded in a container html page. externalinterface allows communication between that container html page and your swf.
p.s. please mark helpful/correct responses.
Copy link to clipboard
Copied
I have tested this in Dreamweaver and live from the server with no success. The button is recognized but will not access the page.
Should I pursue this in a Dreamweaver forum?
Thanks
Copy link to clipboard
Copied
i would first suggest testing using your html published by flash so you can make sure your externalinterface and js code are correct.
Copy link to clipboard
Copied
Thanks
I went back and adjusted the js to include:
<script language="javascript">
function openwindow (URL, windowname, windowfeatures){
window.open(URL, windowname, windowfeatures);
}
</script>
and it works great.
Copy link to clipboard
Copied
you're welcome.