sebbsel (1) [Avatar] Offline
#1
Hi there,

I've bought your book a few days ago.. but at the moment im unable to get past the first listing.

This is my code

<canvas>
<window resizable="true" width="250" height="100">
<text id="msg" text="Hello Laszlo" resize="true" align="center" >

fontsize="${immediateparent.width/7} height="${immediateparent.height}"/>
<animatorgroup process="sequential" repeat="Infinity">
<animatorgroup process="simultaneous">
<animator attribute="width" to="500" duration="1500"/>
<animator attribute="height" to="150" duration="1500"/>
</animatorgroup>
<animatorgroup process="simultaneous">
<animator attribute="width" to="250" duration="1500"/>
<animator attribute="height" to="100" duration="1500"/>
</animatorgroup>
</animatorgroup>
</window>
</canvas>

---------------------------------------------------------------------------------------

and it gives me this error message:

Compilation Errors
Hello.lzx:3:112: Element type "text" must be followed by either attribute specifications, ">" or "/>".


I don't get it. I hope you can help me smilie
badbad214 (4) [Avatar] Offline
#2
Re: Getting Compilation Errors all the time.
Hello,
I am just learning Laszlo but being stuck with the code of the book I am going through the forum. Here is your code that I modified:
<canvas>
<window resizable="true" width="250" height="100">
<text id="msg" text="Hello Laszlo" resize="true" align="center" >
fontsize="${immediateparent.width/7}" height="${immediateparent.height}"/>
<animatorgroup process="sequential" repeat="Infinity">
<animatorgroup process="simultaneous">
<animator attribute="width" to="500" duration="1500"/>
<animator attribute="height" to="150" duration="1500"/>
</animatorgroup>
</animatorgroup>
<animatorgroup process="simultaneous">
<animator attribute="width" to="250" duration="1500"/>
<animator attribute="height" to="100" duration="1500"/>
</animatorgroup>
</window>
</canvas>

It does work for me like that... may be it will help.
Just added a " after the value of fontsize and moved a </animatorgroup> from the bottom to line 10

AB

Message was edited by:
badbad214
lbjvg (2) [Avatar] Offline
#3
Re: Getting Compilation Errors all the time.
Hi - I deleted the post. The code as written in the text works. I used ()'s when I should have use {}'s and that generated weird behavior that prompted my post. I nearly went blind figuring that out - I can barely see the difference. But now I know to expect {}'s in relation to $'s.

- JV Gallagher

Message was edited by:
lbjvg