Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Contributor
shevbg
Posts: 33
Registered: ‎01-15-2011
My Device: Not Specified

Re: Hyperlink in AlertDialog

What I'm having trouble with is the path.

 

I have tried 

navigateToURL(new URLRequest("file:// " + File.applicationStorageDirectory.nativePath + "rules.html"));

 I have tried adding extra slashes, I've also tried File.applicationDirectory.nativePath, but nothing seems to work, even after I went through all the relevant threads. 

 

Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Hyperlink in AlertDialog

Try :

 

"file://app-storage/rules.html"

 

 

 

 

Please use plain text.
Contributor
shevbg
Posts: 33
Registered: ‎01-15-2011
My Device: Not Specified

Re: Hyperlink in AlertDialog

 

navigateToURL(new URLRequest("file://app-storage/rules.html"));

 

did not work either :smileysad: I have the .html file in the bin-debug folder, src folder, and the main project folder just in case. But it still not working! arggg!

 

Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Hyperlink in AlertDialog

Is the rules.html physically there?  Is it in the BAR file?

Please use plain text.
Contributor
shevbg
Posts: 33
Registered: ‎01-15-2011
My Device: Not Specified

Re: Hyperlink in AlertDialog

I simply have the .html file residing in those directories, just as all my other files (such as images) that I use in the game. Do I have to somehow explicitly add it to the .bar file? Excuse my ignorance, I am fairly new to this. 

 

Thank you!

Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Hyperlink in AlertDialog

[ Edited ]

The application storage directory is a runtime directory for the app.  So either you need to create the file in the application and saved it there, or during initial run, you moved it there.  The runtime environment has no knowledge of a /src directory.

 

Go to the application storage directory and copy the rules.html in there to get the UI to work (getting the URL correct).  If that works, then you will need to package the file up as part of the BAR file to the simulator.  Then change the code to look for the file in the application directory (instead of the application storage directory).  Believe "file://app/rules.html" will work.  You can probably use the File native path to the application directory to work as well.

 

I believe the "app" directory while in FB is the bin-debug directory.

Please use plain text.
Contributor
shevbg
Posts: 33
Registered: ‎01-15-2011
My Device: Not Specified

Re: Hyperlink in AlertDialog

Thank you John, that makes sense. How exactly do I accomplish that, however?

 

This is what I have so far:

 

 

var htmlFile:File = new File("/info.html");

 

 

Now using that file object, what exactly do I do to get it into the .bar file?

 

Thank you

Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Hyperlink in AlertDialog

Guess I meant:

 

var file : File = File.applicationDirectory.resolvePath( 'info.html' );
navigateToURL( new URLRequest( 'file://' + file.nativePath ), "_blank" );

 

Please use plain text.
Contributor
shevbg
Posts: 33
Registered: ‎01-15-2011
My Device: Not Specified

Re: Hyperlink in AlertDialog

[ Edited ]

Thank you for your reply. However, I tried this, and a number of variations of this, but it still won't load the html file...frustrating

Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Hyperlink in AlertDialog

It worked fine in AIR.  Try 'file:///'?

Please use plain text.