#1 2015-09-02 13:46:09

impulsmedia
Member
Registered: 2015-04-21
Posts: 64

variables set by external javascript - something wrong?

Hello,
I check the position of a js videoplayer with this code in index.html:

<script type="text/javascript">

   function onendedFunction(e) {
        alert("Mobilvideo Ende");
        window.App.Scope.movieend ="end";
   }

   function streamcomplete(txt) {
        alert("Flashplayer Video Ende");
        window.App.Scope.movieend ='end'; 
   } 

</script> 

But his doen´t work. Before the last changes of AppBuilder I used:

<script type="text/javascript">


   function onendedFunction(e) {
        alert("Mobilvideo Ende");
        window.App.RootScope.movieend ="end";
   }

   function streamcomplete(txt) {
        //alert("Flasplayer Video Ende");
        window.App.RootScope.movieend ="end"; 
  } 

</script> 

This worked fine. Did I missunderstand something?

Thanks,
Walter

Offline

#2 2015-09-02 15:47:13

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: variables set by external javascript - something wrong?

Hello Walter,

In principle "window.App.Scope" is now the way to access app variables. In my tests I can access it without problems, then, please, assert you use the very latest version of App Builder not upgrading from the program, but downloading from their web: www.getappbuilder.com. Uninstall the program and then install the new release. If you continue having problems then I will take a look in more deep.

Offline

#3 2015-09-03 12:23:51

impulsmedia
Member
Registered: 2015-04-21
Posts: 64

Re: variables set by external javascript - something wrong?

Hello David,

I uninstalled and reinstalled AppBuilder from your website, but still have the same problem. The external function itself works fine because I get  the control alert. In my script I watch the var movieend with a timer control every 500ms ...

Thanks for your help
Walter

Offline

#4 2015-09-03 13:47:14

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: variables set by external javascript - something wrong?

Hello Walter,

You are completely right and I am wrong. The problem is that some variables are accesibles and not others, depending in where the variables are defined. Please, sorry for the inconveniences. I am working right now for a solution.

Offline

#5 2015-09-03 14:10:08

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: variables set by external javascript - something wrong?

Hello again,

Well. Apparently we can't go without the "window.App.RootScope" variable. I update right now the program give us access to "window.App.RootScope" and "window.App.Scope". The first variable can be used to access app variables, just like you do in your app. The second one can be used to access app functions.

The External Javascript tutorial has been updated as well the External app sample.

Sorry for the inconveniences and thanks for the advise Walter.

Offline

#6 2015-09-03 16:22:21

impulsmedia
Member
Registered: 2015-04-21
Posts: 64

Re: variables set by external javascript - something wrong?

Now everthing works again. Thank you!

Offline

Board footer

Powered by FluxBB


Copyright ©2018 DecSoft. All rights reserved.