Author Topic: bug in txt-element version 1.3.6  (Read 3826 times)

moby

  • Newbie
  • *
  • Posts: 3
bug in txt-element version 1.3.6
« on: May 28, 2009, 09:13:03 pm »
Hello Florian and all

I don't know whether it is a bug or not.

When I put the following line in my xml-script then NOT only the text 'this is a text' appears on my page but also the attributes '0xFF0000', '20' an '30'.

<txt color="0xFF0000" left="20" top ="30"><txt>this is a text</txt></txt>

Can anyone help me??

moby

maxie

  • Jr. Member
  • **
  • Posts: 43
Re: bug in txt-element version 1.3.6
« Reply #1 on: May 29, 2009, 07:24:57 pm »
I have had the same problem, not only in 1.3.6, but also in 1.3.5. I tried to avoid this by making some blank passages, but, after all, I did not like this "work-around" myself. I decided (for the time until there is a better way) to not use text with the <txt> tag now. I edit the text in the picture editor now, i.e. write directly onto the page image.

I would love to read, too, who uses the <txt> tag for the books and what they do in order to avoid that the format values appear under the text ...

moby

  • Newbie
  • *
  • Posts: 3
Re: bug in txt-element version 1.3.6
« Reply #2 on: May 30, 2009, 06:21:52 pm »
Thanks for the interest on my posting

I would like to prefer the <txt>-tag because of the following reason:
Based on an Access-DB the pages-part in the xml-file should be created automatically with frequently changing text on the pages. To avoid very much work on editing each picture when the text changes I found for myself the <txt>-tag the best solution.

Maxie, could you please tell me what you meant with "...making some blank passages..."?
Probably I can use this for my purpose.

maxie

  • Jr. Member
  • **
  • Posts: 43
Re: bug in txt-element version 1.3.6
« Reply #3 on: May 30, 2009, 07:08:48 pm »
Hi Moby,

I did it the same way like you, but pressed the return key  (or: ENTER) after the last passage. But I doubt this is a helpful way for you, because you would have to always countercheck when you arrive at the  "end of the page" with your text, so you can "hide" the clear text attributes behind some <return>s.

(<txt top="10" left="10" align="justify">)
One usually structures the text in passages. <return>
So I start a new passage here, on this new line. Makes sense. <return>
Another nice passage, but I see that I have reached almost the end of my page.<return>
<return>
<return>
<return>
(</txt>)

I doubt that this will help you, because one has to countercheck when the text arrives at the end of the page, in order to enter the <return>s.

I would love to hear from the others how to work with the txt tag! Is there really nobody out there besides Moby and me who uses this?
Come on please, show us how to do it correctly!

Kind regards,
Maxie

daniela

  • Newbie
  • *
  • Posts: 5
Re: bug in txt-element version 1.3.6
« Reply #4 on: May 31, 2009, 09:30:56 am »
Hi moby and maxy

I have the same problem and am relieved it's not just me. Tried all sort of things, but can't get rid of the attribute values printing after the text. And I need to load the text in "on the fly" as well. I do have CS3 and could have a go at the source code, but didn't quite work out where, yet. Any ideas? Have only just found megazine, think it's brilliant, particularly because of AS3 support and text ability, which was exactly what I was looking for.

by the way: pressing the return key does not work for me
what works is this:

<txt align='center' color='0xffffff'>trial text&#13;&#13;&#13;&#13;&#13;&nbsp;
</txt>

&#13; for returns, but then still needs an extra character (here &nbsp;) to move the attribute values down..

daniela
« Last Edit: May 31, 2009, 09:57:09 am by daniela »

maxie

  • Jr. Member
  • **
  • Posts: 43
Re: bug in txt-element version 1.3.6
« Reply #5 on: May 31, 2009, 10:12:27 am »
Hello Daniela,

So now we are already three.

by the way: pressing the return key does not work for me
[...]
&#13; for returns, but then still needs an extra character (here &nbsp;) to move the attribute values down..

This is strange, because for me it felt like working with a text processor, for instance, WORD. :-) I did not know this &#13!

I really would like to use <txt>, because the default text looks good, clear and sharp, on the page, at a reasonable small size, so one could place a good amount of text per page. I cannot achieve this quality in my image editing programs.

Kind regards,
Maxie

daniela

  • Newbie
  • *
  • Posts: 5
Re: bug in txt-element version 1.3.6
« Reply #6 on: May 31, 2009, 10:25:10 am »
Quote
This is strange, because for me it felt like working with a text processor, for instance, WORD. :-) I did not know this &#13!

&blabla; are character codes. I load my text in from a database and am running the book on a rails application. rails writes the magazine.xml files dynamically, different versions depending on the user's choice - so new books are produced as needed.
my megazine.xml file looks "normal" but whitespaces and newlines won't be "acknowledged", so I "force" them by writing in the actual character codes (you can look them up in ww3.schools or google them, I am using utf-8, after all we live in a global environment these days... :)

daniela

webtrekker

  • Newbie
  • *
  • Posts: 1
Re: bug in txt-element version 1.3.6
« Reply #7 on: June 01, 2009, 08:44:09 am »
Has anyone been able to sort this out yet? I've tried many arrangements with no luck. :'(

daniela

  • Newbie
  • *
  • Posts: 5
Re: bug in txt-element version 1.3.6
« Reply #8 on: June 02, 2009, 06:03:32 pm »
ok I have sorted it, at least for the moment, until the author is back from wherever he is, what you can do is
1) if you have the source code and can publish an .swf file: in Element.as, around line 200 comment out the line after if(!exists)............. (I copied bits around it below). Don't know what effect it has, if you use the localizer.

         var defLang:String = loc.defaultLanguage;
         for each (var attrib:XML in _xml.attributes()) {
            // Data on default attribute.
            var defName:String = Helper.validateString(attrib.name(), "");
            var defValue:String = Helper.validateString(attrib, "");
            
            // Test if an entry for the default value exists, if not append.
            var exists:Boolean = false;
            for each (var locAttrib:XML in _xml.elements(defName)) {
               var locLang:String = Helper.validateString(locAttrib.@lang, "");
               if (locLang == _localizer.defaultLanguage) {
                  exists = true;

                  
                  
                  break;
               }
            }
            
            if (!exists) {
               //_xml.appendChild("<" + defName + " lang=\"" + defLang + "\">" + defValue + "</" + defName + ">");
            }
         }
         
         setAttributesToLanguage(_localizer.language);
         _localizer.addEventListener(LocalizerEvent.LANGUAGE_CHANGED, onLanguageChange);
      }

2) for those who do not have the possibility to publish, I have a "new" megazine.swf available. can one upload things anywhere around here?

daniela  :)



maxie

  • Jr. Member
  • **
  • Posts: 43
Re: bug in txt-element version 1.3.6
« Reply #9 on: June 02, 2009, 09:09:51 pm »
Hi Daniela,
I think Florian is spending his well-deserved vacation. I read somewhere in his posts that he will be back around June 20th.

I cannot work with FLA, because I do not have Adobe Flash. (If this is what you meant by "publish an .swf file".) I would be very interested in trying out your megazine.swf! Please let me know when and where I can download it.

By the way, I have seen your creative use of megazines recently. (Nice cartoons also.) Did you resize the books via just minimizing the percentage of the movie or did you change the fla for this? Just curious.  :)

Kind regards,
Maxie

daniela

  • Newbie
  • *
  • Posts: 5
Re: bug in txt-element version 1.3.6
« Reply #10 on: June 02, 2009, 09:25:02 pm »
hia, thought he would be on holiday. but he'll have to sort it out properly when he is back. i could email the .swf to you.
where have you seen my books? if you went on softlearning, that's still the old books, they were flipping pages, they don't support text, so I put a whole layer over each left page, which makes it load awkwardly. and flipping pages is actionscript 2 support only, so i was very excited when i discovered this project with genuine text support (could be more extensive  :D)
i have just added an onclick function to the images, because i want to be able to ajax when users click an image in the book, not go to a url...
it's a really cool engine this one here!!!!! well done Florian, though I encountered this when he is absent...

and about the size (obviously this is adapted to my needs):
the pagewidth and height are self-explanatory
the 300 300 in the swfobject are the size of the swf, 2x150=300 for width and for the height it needs some extra because the stiff coverpage is 300 high..

in the megazine.xml file:
    <!DOCTYPE book SYSTEM 'http://megazine.mightypirates.de/megazine.dtd'>
    <book pagewidth='150' pageheight='200' dragrange='75' navigation="false"> etcetc

in my html (well, it is in a javascript file):
swfobject.embedSWF("path_to_your_file/megazine.swf", "megazine", "300", "300", "9.0.115", false, movies.megaz.flashvars, movies.megaz.params, movies.megaz.attr);

« Last Edit: June 02, 2009, 10:26:38 pm by daniela »

maxie

  • Jr. Member
  • **
  • Posts: 43
Re: bug in txt-element version 1.3.6
« Reply #11 on: June 02, 2009, 10:26:24 pm »
Thank you. Going to send you a PM.  :)

chris

  • Newbie
  • *
  • Posts: 1
Re: bug in txt-element version 1.3.6
« Reply #12 on: June 03, 2009, 08:05:10 am »
Having all the same problems mentioned here... could you maybe upload your megazine.swf to http://www.rapidshare.de/ or something similar?

daniela

  • Newbie
  • *
  • Posts: 5
Re: bug in txt-element version 1.3.6
« Reply #13 on: June 03, 2009, 08:33:22 am »
yes, here it is

http://rapidshare.de/files/47399728/megazine.swf.html

but do remember:
1) keep your original copy somewhere backed up
2) i have not particularly tested it and don't know what happens if you use the book with localizer
3) replace it with whatever florian will come up with, once he is back

all best
daniela
« Last Edit: June 03, 2009, 08:39:48 am by daniela »

moby

  • Newbie
  • *
  • Posts: 3
Re: bug in txt-element version 1.3.6
« Reply #14 on: June 03, 2009, 03:50:48 pm »
Hi,
I have tried to solve the problem like Maxie suggested putting the number of needed blank text
simply as <txt></txt> in the page-tag:

<txt align="left" width="80" height="30" left="30" top="30">
             <txt>blablabla</txt>
             <txt></txt>
             <txt></txt>   (... and so on)
</txt>

It worked, but created a new problem. The links on my page are not longer visible to click because the textbox covers the whole length and width of the page. The element 'txt width' works and so I could get a part of my page not coverd by the textbox,
but the element 'txt height' doesn't work: the textbox always gets as high as many text you put in.

Now I've downloaded the megazine.swf from Daniela and it really works fine for my purposes.
Thanks a lot to Daniela!!!

Moby