tag:robotlegs.tenderapp.com,2009-10-18:/discussions/problems/299-custom-osmf-plugin-with-robotlegs-issues-with-child-applicationdomaingetdefinition-referenceerror-error-1065-variableRobotlegs: Discussion 2013-04-28T09:54:25Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/66165492011-04-13T17:15:15Z2011-04-13T17:15:17ZCustom OSMF Plugin with robotlegs issues with Child ApplicationDomain/getDefinition() ReferenceError: Error #1065: Variable<div><p>ok so have built an example testcase together and it all works
beautifully. doh<br>
although loading the testcase plugin into my real OSMF player is
still not working to the problem must be there. i'll keep
investigating and let you know my findings.</p>
<p>BTW love a bit of robotlegs ... thanks shaun</p></div>Ben Smithtag:robotlegs.tenderapp.com,2009-10-18:Comment/66165492011-04-13T17:43:24Z2011-04-13T17:43:25ZCustom OSMF Plugin with robotlegs issues with Child ApplicationDomain/getDefinition() ReferenceError: Error #1065: Variable<div><p>ok so i have managed to break my testcase with the same error im
getting in my main project by adding a robotlegs context to the
root sample player.</p>
<p>var context:PlayerContext = new PlayerContext(this);</p>
<p>So when it is not there everything work ok but as soon as both
parent and child create a context it breaks.</p></div>Ben Smithtag:robotlegs.tenderapp.com,2009-10-18:Comment/66165492011-04-13T17:50:43Z2011-04-13T17:50:44ZCustom OSMF Plugin with robotlegs issues with Child ApplicationDomain/getDefinition() ReferenceError: Error #1065: Variable<div><p>Not sure what can be done now over to you guy.</p>
<p>I have attached my sample testcase projects<br>
there is 4 projects you have to load up in fb<br>
i was also using the latest Flex 4.5.0.19786</p>
<p>:(</p></div>Ben Smithtag:robotlegs.tenderapp.com,2009-10-18:Comment/66165492011-04-14T00:15:36Z2011-04-14T00:15:38ZCustom OSMF Plugin with robotlegs issues with Child ApplicationDomain/getDefinition() ReferenceError: Error #1065: Variable<div><p>Ok and here is the solution / workaround that i have found.</p>
<p>In the parent movie (i have not tried it the other way round)
the one that loads the second swf i found that you could not
explisity create the Context class with errors ... but if you
getDefinitionByName on the context class it works fine:</p>
<p>import flash.utils.getDefinitionByName;<br>
import flash.utils.getQualifiedClassName;</p>
<p>var classname:String = getQualifiedClassName(PlayerContext);<br>
var PlayerClass:Class = getDefinitionByName(classname) as
Class;<br>
var playerContext:IContext = new PlayerClass(this) as IContext;</p>
<p>and you can call custom methods like this:</p>
<p>(playerContext as PlayerContext).initPlayer();</p>
<p>hopefully this will help someone not spend as much time as i
have.</p>
<p>Ben</p></div>Ben Smithtag:robotlegs.tenderapp.com,2009-10-18:Comment/66165492011-04-14T05:54:40Z2011-05-02T13:29:32ZCustom OSMF Plugin with robotlegs issues with Child ApplicationDomain/getDefinition() ReferenceError: Error #1065: Variable<div><p>Player with playhead updates, and all its takes to play... I see
very little point in adding RobotLegs on it, I mean, Injection has
a price.</p>
<p>In the approach below, not even events are dispatched, but a
reference of a interface to hold all events to make it cheaper (see
image)<br>
<a href=
"http://blog.mariovieira.net/flash-platform/osmf-player-examples/">http://blog.mariovieira.net/flash-platform/osmf-player-examples/</a></p></div>Maz Kobatag:robotlegs.tenderapp.com,2009-10-18:Comment/66165492011-04-14T10:51:49Z2011-04-14T10:51:50ZCustom OSMF Plugin with robotlegs issues with Child ApplicationDomain/getDefinition() ReferenceError: Error #1065: Variable<div><p>Arrrrrrrr ok so this fix was a fale positive and dose not work
... back to the drawing board.</p>
<p>here is my currently broken testcase.</p>
<p>any suggestions would be great.</p></div>Ben Smithtag:robotlegs.tenderapp.com,2009-10-18:Comment/66165492011-04-14T12:15:17Z2011-04-14T12:15:17ZCustom OSMF Plugin with robotlegs issues with Child ApplicationDomain/getDefinition() ReferenceError: Error #1065: Variable<div><p>DId you define the applicationDomain for the child application
correctly? Because if it's in its own sandbox, the loading
application cannot access the classes inside it and vice versa.</p></div>creynderstag:robotlegs.tenderapp.com,2009-10-18:Comment/66165492011-04-15T06:54:45Z2011-04-15T06:54:46ZCustom OSMF Plugin with robotlegs issues with Child ApplicationDomain/getDefinition() ReferenceError: Error #1065: Variable<div><p>I'm not sure i have OSMF framework dose the loading ... i'll
look into trying to do that but not sure how to atm.</p>
<p>thanks creyders</p></div>Ben Smithtag:robotlegs.tenderapp.com,2009-10-18:Comment/66165492011-04-15T08:02:57Z2011-04-15T08:02:57ZCustom OSMF Plugin with robotlegs issues with Child ApplicationDomain/getDefinition() ReferenceError: Error #1065: Variable<div><p>Ok, then that's probably not the problem.<br>
I'm not sure whether this will solve your problem, but you
shouldn't refer to the PlayerContext class directly in your main
application, because it will get compiled into the same swf and
that obviously defeats the purpose. You should define an interface
for your PlayerContext class and cast the instance you create of it
with getDefinitionByName to the interface. This way only the
interface gets compiled into both swf's and not the PlayerContext
class itself.<br>
That being said, to me it appears very strange that you'd create
the PlayerContext class in the main application. I'm certainly no
expert when it comes to modules, but I'd think you leave the
instantiation of the PlayerContext class to the child
application/document class and simply provide it with the necessary
data to communicate to the main application class.</p></div>creynderstag:robotlegs.tenderapp.com,2009-10-18:Comment/66165492011-11-01T17:17:24Z2011-11-01T17:17:24ZCustom OSMF Plugin with robotlegs issues with Child ApplicationDomain/getDefinition() ReferenceError: Error #1065: Variable<div><p>Feel free to reopen this discussion in case you have more
questions or you need further assistance with this issue. Please
open new threads for new issues.<br>
Thank you for posting<br>
Ondina</p></div>Ondina D.F.