Title: ExternalInterface Post by: newtriks on October 14, 2007, 06:43:04 Hi,
Having trouble with ExternalInterface.addCallback(); in my Proxy, i.e. retrieving the data, the call back method doesn't seem to run in the proxy and hints? cheers, Simon Title: Re: ExternalInterface Post by: puremvc on October 14, 2007, 07:51:27 Can you post a snippit?
-=Cliff> Title: Re: ExternalInterface Post by: newtriks on October 14, 2007, 08:09:59 package com.newtriks.model I am applying the puremvc framework to a Flash CS3 project for a change and there are definate obstacles after lots of Flex usage. One other area you I am sure can help is with this issue: interacting with movieclips on the stage. I have a StageMediator but am having trouble referencing items already on the stage? stage.addEventListener( MouseEvent.CLICK, onStageClick ); works fine! stage.myButton.addEventListener( MouseEvent.CLICK, onButtonClick ); ? access of undefined property ? P.S. I have been hammering away non stop for 3 days now day and night so simple things have got stupid??? Title: Re: ExternalInterface Post by: puremvc on October 14, 2007, 10:06:52 Simon,
Though you can be sure to test on a browser supporting ExternalInterface, you can never be sure the user will. So a good first step in this method would be to insure that ExternalInterface.available == true, otherwise we know any further attempts to communicate with it will be futile. Next, how is the getData/gotData supposed to work? What does the HTML in the browser look like? I'm guessing something like: <form> With something so potentially easy to get wrong as ExternalInterface communications, I'd do some 'hello world' work with a simple class first, without PureMVC even in the picture. Be sure you are able to easily pass data back and forth and that your communications with the Javascript world are all sound first. Othewise you can really end up chasing your tail. For instance, I'm working on a FlashLite game with a soon to be released AS2 port of PureMVC. It's all working great right now, but I really had to get my head around how things work in a phone first. Lots of simple tests to make sure I could listen to the soft keys, load in new levels be without blowing memory, etc. All those things needed to be worked out on their own terms before I could think about how to marry them to a PureMVC app. But now that they are worked out it's smooth sailing. I expect the same will be true with your ExternalInterface woes. Also, the Stage is a weird beast. That button is not a child of the Stage, but of a movie clip on the stage, probably _root. The stage object has a root property. Most likely stage.root.myButton is what you're after. -=Cliff> Title: Re: ExternalInterface Post by: newtriks on October 14, 2007, 01:26:42 As always mate thanks very much. I much prefer working in Flex now I have decided, I know it equally has its problems but its surprising how much I have warmed to it over time and also how well I found your framework assisted my application development.
Regarding the testing, I had tested it and had used (but took out for a small snippet of the code here) ExternalInterface.available == true. Your advise is good man thanks :) |