Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Testing the HellowWorld in AIR - problem with hashMap and flash.utils.IExternalizable
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Murrah  
View profile  
 More options Jan 3 2011, 8:41 pm
From: Murrah <mur...@murrah.com.au>
Date: Mon, 3 Jan 2011 17:41:03 -0800 (PST)
Local: Mon, Jan 3 2011 8:41 pm
Subject: Testing the HellowWorld in AIR - problem with hashMap and flash.utils.IExternalizable
Hi,

I am attempting to use purePDF in my AIR app. The app is a JavaScript
app, not a Flex app. However, in AIR it is possible to access
ActionScript classes from the HTML/JS app and I have tested that
successfully with small AS classes. I should state that my AS/Flex
knowledge is almost non existant! And I am learning fast!

What I have done is:

1. I added the following method to the HelloWorld class:
public function doMyPdf() : void {
  execute();

}

   since it seems I cant call the execute method since it is
protected.

2. I compiled the HelloWorld.as example using compc and including the
relevant swc files. So far so good - compiles ok.

3. I extracted the library.swf file from the swc file created in step
2 and renamed it mypdf.swf

4. In my AIR app I included the file: <script src="lib/mypdf.swf"
type="application/x-shockwave-flash"></script>

5. Finally, I execute it via JS:
var lib = new window.runtime.HelloWorld();
lib.doMyPdf();

And it runs. The debug window displays the following messages which
are being generated by the swf file so it is clear that it is starting
to run. However, I am getting the error below:

setting up as3_jpeg_wrapper library

Welcome to purepdf 0.74.20100527

Error: Error #2173: Unable to read object in stream.  The class
it.sephiroth.utils::HashMap does not implement
flash.utils.IExternalizable but is aliased to an externalizable class.

When I visit the HashMap source code I see that
flash.utils.IExternalizable is imported as I expected.

So, what can this error mean?

If I can get this working I intend to make and share a wrapper class
for purePDF so other JS AIR developers can finally produce client side
PDF files! Yes! (I did a similar thing for iText in ColdFusion, but
havent released it yet - still working on it)

Thanks for your help,
Murray


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alessandro Crugnola  
View profile  
 More options Jan 4 2011, 2:46 am
From: Alessandro Crugnola <alessandro.crugn...@gmail.com>
Date: Tue, 4 Jan 2011 08:46:06 +0100
Local: Tues, Jan 4 2011 2:46 am
Subject: Re: [purepdf-discuss] Testing the HellowWorld in AIR - problem with hashMap and flash.utils.IExternalizable

Did you read this post?
http://www.flashsecrets.com/2009/04/argumenterror-error-2173-unable-t...

sometimes when you compile external swc projects with compc which will be dynamically loaded you can have those kind of problems. that's why usually i prefer to compile them directly in swf and no in swc.

On 04/gen/2011, at 02.41, Murrah wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Murrah  
View profile  
 More options Jan 4 2011, 6:09 am
From: Murrah <mur...@murrah.com.au>
Date: Tue, 4 Jan 2011 03:09:58 -0800 (PST)
Local: Tues, Jan 4 2011 6:09 am
Subject: Re: Testing the HellowWorld in AIR - problem with hashMap and flash.utils.IExternalizable
Thanks Alessandro.

Yes, I did read that post and tried adding the suggested code to both
classes (HelloWorld and DefaultBasicExample) but it made no
difference. I also needed to import it.sephiroth.utils.HashMap because
the compiler choked on the private static var _link:Array =
[it.sephiroth.utils.HashMap]; line if I didnt. ie

import it.sephiroth.utils.HashMap;

public class HelloWorld extends DefaultBasicExample
{
  private static var _link:Array = [it.sephiroth.utils.HashMap];
  ...

}

I also switched to using the mxmlc compiler as you suggested (but it
still hasnt solved the problem). ie

amxmlc -library-path+=pdflib HelloWorld.as

The folder pdflib contains:
as3_jpeg_wrapper.swc
as3commons-logging-1.1.swc
as3corelib.swc
purePDF.swc
purePDFont.swc

By process of elimination I find that the problem is with the
document.add() method. eg
var paragraph: Paragraph = new Paragraph("My line");
document.add(paragraph);

If I comment out the document.add(paragraph); then the process runs to
the end (and displays the "Document has no pages" error message as you
would expect since that is the only content I am adding). ie

setting up as3_jpeg_wrapper library
Welcome to purepdf 0.74.20100527
Error: The document has no pages

Thanks again for your help.
Regards,
Murray

On Jan 4, 6:46 pm, Alessandro Crugnola <alessandro.crugn...@gmail.com>
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
nino ekambi  
View profile  
 More options Jan 6 2011, 6:22 pm
From: nino ekambi <jazzmatad...@googlemail.com>
Date: Fri, 7 Jan 2011 00:22:47 +0100
Local: Thurs, Jan 6 2011 6:22 pm
Subject: Re: [purepdf-discuss] Re: Testing the HellowWorld in AIR - problem with hashMap and flash.utils.IExternalizable

Could you solve the problem ?
Regards,
Alain

2011/1/4 Murrah <mur...@murrah.com.au>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Murrah  
View profile  
 More options Jan 7 2011, 4:28 pm
From: Murrah <mur...@murrah.com.au>
Date: Fri, 7 Jan 2011 13:28:53 -0800 (PST)
Local: Fri, Jan 7 2011 4:28 pm
Subject: Re: Testing the HellowWorld in AIR - problem with hashMap and flash.utils.IExternalizable
No, I gave up. No idea. I shifted to AlivePDF instead for now. I might
revisit this at some time. I know iText is a great package but maybe
AlivePDF will suffice for my needs.

Alain, I know you know about this post of my exploring this idea, but
for others:

http://murrayhopkins.wordpress.com/2011/01/07/using-alivepdf-to-print...

Cheers,
Murray

On Jan 7, 10:22 am, nino ekambi <jazzmatad...@googlemail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
nino ekambi  
View profile  
 More options Jan 7 2011, 5:17 pm
From: nino ekambi <jazzmatad...@googlemail.com>
Date: Fri, 7 Jan 2011 23:17:14 +0100
Local: Fri, Jan 7 2011 5:17 pm
Subject: Re: [purepdf-discuss] Re: Testing the HellowWorld in AIR - problem with hashMap and flash.utils.IExternalizable

Well i  founded a solution for the problem just can remenber  exactly  where
that was cuz  the error is realy hidden though.
I ll hav a look at  it  and let u know. If you want to write  a  JS wrapper
around AlivePDF maybe  you can look  in the source code  of Gwt4Air 1.1. I
hav  a module for AlivePDF there.

Regards,

Alain

2011/1/7 Murrah <mur...@murrah.com.au>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Murrah  
View profile  
 More options Jan 7 2011, 5:29 pm
From: Murrah <mur...@murrah.com.au>
Date: Fri, 7 Jan 2011 14:29:09 -0800 (PST)
Local: Fri, Jan 7 2011 5:29 pm
Subject: Re: Testing the HellowWorld in AIR - problem with hashMap and flash.utils.IExternalizable
Thanks Alain! I was thinking f doing that since I will proabably need
to replicate much of the API !

Cheers,
Murray

On Jan 8, 9:17 am, nino ekambi <jazzmatad...@googlemail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
nino ekambi  
View profile  
 More options Jan 7 2011, 6:14 pm
From: nino ekambi <jazzmatad...@googlemail.com>
Date: Sat, 8 Jan 2011 00:14:32 +0100
Local: Fri, Jan 7 2011 6:14 pm
Subject: Re: [purepdf-discuss] Re: Testing the HellowWorld in AIR - problem with hashMap and flash.utils.IExternalizable

You welcome :).
Yeah you will hav to export about 90% of the API to JS, And this is a lot of
work :). but the end result is always  a pleasure :)
The other thing is that  the user of  you library will probably hav to
download the  hole JS library even if the  are just using a small part of
it.
That s the reason why i decided to go the  Java and GWT  way. Since GWT just
compile the JS you are actually using in your code.

If you hav any question feel free to  contact me

Regards,

Alain

2011/1/7 Murrah <mur...@murrah.com.au>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »