Re: Last few problems converting browser project to JS

2018-03-08 Thread doug777
Oh yes of course, silly me. I've actually used this method to replace missing
parameters like 'data' in lots of other places in the app.

Many thanks for all your help.

Doug



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/


Re: Last few problems converting browser project to JS

2018-03-08 Thread Harbs
Good idea.

I’ll try to do that…

> On Mar 8, 2018, at 9:04 PM, Alex Harui  wrote:
> 
> It would be great to identify a bead from this pattern so others can just
> drop a bead in their code instead of having to add a parameter and use
> bracket access.
> 
> I forgot that EscapedFragmentBead extends URLParameterBead.  The
> URLParameter bead currently just returns the entire query string, but some
> other API could have it generate a ValueObject which would prevent naming
> problems or have a query API like getParameter that would force you to use
> string IDs that wouldn't be renamed.
> 
> We want to try to package just about any solution as a bead so others
> don't have to repeat the same set of steps.
> 
> My 2 cents,
> -Alex
> 
> On 3/8/18, 1:50 AM, "Harbs"  > wrote:
> 
>> Just add the following to your main class:
>> 
>> public var parameters:Object;
>> 
>> Also: Make sure you use bracket access (i.e. this.parameters[“anything”]
>> instead of this.parameters.anything) to the parameters var to prevent
>> renaming problems when it’s minified.
>> 
>> HTH,
>> Harbs
>> 
>>> On Mar 8, 2018, at 3:48 AM, doug777  wrote:
>>> 
>>> Hi Harbs,
>>> 
>>> I don't understand how to access these parameters in the app's main file
>>> since Application.parameters.anything won't compile.
>>> 
>>> Doug
>>> 
>>> 
>>> 
>>> --
>>> Sent from: 
>>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-ro 
>>> 
>>> yale-users.20374.n8.nabble.com 
>>> %2F=02%7C01%7Caharui%40adobe.com
>>>  %7C13c
>>> a54a2853147d8382808d584d9fe48%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%
>>> 7C636560994180269800=3XoMuxOTZ60XBW85rNwRklOqyspeMbKjhntwyW7O3v0%3D
>>> =0



Re: Last few problems converting browser project to JS

2018-03-08 Thread Alex Harui
It would be great to identify a bead from this pattern so others can just
drop a bead in their code instead of having to add a parameter and use
bracket access.

I forgot that EscapedFragmentBead extends URLParameterBead.  The
URLParameter bead currently just returns the entire query string, but some
other API could have it generate a ValueObject which would prevent naming
problems or have a query API like getParameter that would force you to use
string IDs that wouldn't be renamed.

We want to try to package just about any solution as a bead so others
don't have to repeat the same set of steps.

My 2 cents,
-Alex

On 3/8/18, 1:50 AM, "Harbs"  wrote:

>Just add the following to your main class:
>
>public var parameters:Object;
>
>Also: Make sure you use bracket access (i.e. this.parameters[“anything”]
>instead of this.parameters.anything) to the parameters var to prevent
>renaming problems when it’s minified.
>
>HTH,
>Harbs
>
>> On Mar 8, 2018, at 3:48 AM, doug777  wrote:
>> 
>> Hi Harbs,
>> 
>> I don't understand how to access these parameters in the app's main file
>> since Application.parameters.anything won't compile.
>> 
>> Doug
>> 
>> 
>> 
>> --
>> Sent from: 
>>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-ro
>>yale-users.20374.n8.nabble.com%2F=02%7C01%7Caharui%40adobe.com%7C13c
>>a54a2853147d8382808d584d9fe48%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%
>>7C636560994180269800=3XoMuxOTZ60XBW85rNwRklOqyspeMbKjhntwyW7O3v0%3D
>>=0
>



Re: Last few problems converting browser project to JS

2018-03-08 Thread Harbs
Just add the following to your main class:

public var parameters:Object;

Also: Make sure you use bracket access (i.e. this.parameters[“anything”] 
instead of this.parameters.anything) to the parameters var to prevent renaming 
problems when it’s minified.

HTH,
Harbs

> On Mar 8, 2018, at 3:48 AM, doug777  wrote:
> 
> Hi Harbs,
> 
> I don't understand how to access these parameters in the app's main file
> since Application.parameters.anything won't compile.
> 
> Doug
> 
> 
> 
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/



Re: Last few problems converting browser project to JS

2018-03-07 Thread Harbs

> On Mar 7, 2018, at 5:35 AM, doug777  wrote:
> 
> I have almost finished converting my old Flex browser app to FlexJS (js
> only), but I have 4 problems left that I can't find a way to convert. Can
> anyone help to suggest a way to go with these items?
> 
> 1. Application.parameters - I need to pass variables into the app on
> creation.

Here’s how I do it:

I have the following markup in the html template I’m using for my app:

My main application class has a parameter setter which does the “right” thing 
with the parameters (very similar to how it works in Flex).


  
function queryURL() {
  // This function is anonymous, is executed immediately and 
  // the return value is assigned to QueryString!
  var query_string = {};
  var query = window.location.search.substring(1);
  if(!query){return {};}
  var vars = query.split("&");
  for (var i=0;i

Re: Last few problems converting browser project to JS

2018-03-06 Thread Justin Mclean
Hi,

> It will work, but IMO it is a bit of a hack.  No real need to add a class
> to your app just to inject HTML in your app.

It reads well in the application I think which counts for something, I’m sure 
there are many other ways of doing the same thing.

> That's why we have the -html-template compiler option.  Normally inject_html 
> is used to inject
> HTML needed to operate the rest of the code in the class.
> 
> Not sure it makes sense to subclass BeadViewBase either since it isn't a
> View.

That code was written in the FLexJS days so there may be a better way to do it. 
I recall playing with the html-template compiler option but I couldn't get it 
to do what I wanted but can’t recall why. Is it supported in maven?

Thanks,
Justin

Re: Last few problems converting browser project to JS

2018-03-06 Thread Alex Harui
It will work, but IMO it is a bit of a hack.  No real need to add a class
to your app just to inject HTML in your app.  That's why we have the
-html-template compiler option.  Normally inject_html is used to inject
HTML needed to operate the rest of the code in the class.

Not sure it makes sense to subclass BeadViewBase either since it isn't a
View.

My 2 cents,
-Alex

On 3/6/18, 9:54 PM, "doug777"  wrote:

>I'll certainly give that a try. Thanks very much Justin.
>
>Doug
>
>
>
>--
>Sent from: 
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-roy
>ale-users.20374.n8.nabble.com%2F=02%7C01%7Caharui%40adobe.com%7C4bca0
>15eb65d43b9edac08d583efee63%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C6
>3655991213108=Twjb06WPYmUxcYX65TUFQGvyoZtXUOXrUeGWO5vzaUA%3D
>erved=0



Re: Last few problems converting browser project to JS

2018-03-06 Thread Piotr Zarzycki
Cool! I just wanted to have clarification. Maybe Royale JS only ;) Not
sure. I'm really happy that you were able to goes so far and you are using
Moonshine. :)

Thanks, Piotr

2018-03-07 7:10 GMT+01:00 doug777 :

> Piotr
>
> I guarantee everything is Royale  - I just wanted to indicate that it's a
> js
> only project. Should I say Royale JS?
>
> Doug
>
>
>
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>



-- 

Piotr Zarzycki

Patreon: *https://www.patreon.com/piotrzarzycki
*


Re: Last few problems converting browser project to JS

2018-03-06 Thread doug777
Hi Piotr,

I hope I can do that but I think I'm still some way from finishing. Although
I've been testing snippets as I've gone along, I'm pretty sure there will
still be lots of problems once it all has to work together. But I can't test
that till I can get the whole thing to compile.

But having got this far I am very confident that it will all work
eventually. I'm really keen to see how close it will be in looks and
functions to the original Flex project.

And I have to say how much I'm enjoying doing it all in Moonshine. It's
still a little bit buggy, but I love using it and it keeps getting better
and better. Really hope to see version 1.10 soon!!

Doug





--
Sent from: http://apache-royale-users.20374.n8.nabble.com/


Re: Last few problems converting browser project to JS

2018-03-06 Thread doug777
I'll certainly give that a try. Thanks very much Justin.

Doug



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/


Re: Last few problems converting browser project to JS

2018-03-06 Thread Justin Mclean
Hi,

Sorry this bounced, so my emails will be out of order, trying again.

> Re EmbedFont : Actually it's not that important. We use it to get special
> characters

In that case something like this may work:


  

   
   
   
...

In fonts/Catamara.as

package fonts {
import org.apache.flex.core.BeadViewBase;

public class Catamaran extends BeadViewBase {
/**
 *  
 *  https://fonts.googleapis.com/css?family=Catamaran:400,500,600,700;>
 *  
 */
public function Catamaran() {
   super();
   }
}
}

Thanks,
Justin

Re: Last few problems converting browser project to JS

2018-03-06 Thread Piotr Zarzycki
Hi Doug,

Great to hear that! Once you finished and if it will be possible share with
us link, screens etc. Maybe we can place it somewhere as a great news. :)

Thanks,
Piotr

On Wed, Mar 7, 2018, 05:47 doug777  wrote:

> Ok that is all very helpful.
>
> Thanks so much, Alex. Much appreciated.
>
> Doug
>
>
>
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>