Hi,I am using an htmlloader component in which i am adding a pdf.pdf
is loaded on to a canvas.The code is like
var pdfString:String;
public function loadPDF():void
{
var pdf:HTMLLoader = new HTMLLoader();
pdf.height = maincanvas.height;
pdf.width = maincanvas.width;
var req = new URLRequest(stringPath);
//stringpath is a dynamically changing value the file path
//referencing to mydocuments directory with File.documentsDirectory
value
//appended with pdfstring:String which is the name of the pdf document
//I have checked both the pdfString and stringPath both of them change
pdf.load(req);
canvas.addChild(pdf);
pdf = null;
}
<viewStack>
<canvas>
<button click="loadPDF()"/>
</canvas>
<canvas id="maincanvas" creationComplete ="loadPDF()">
<canvas id="canvas"/>
</canvas>
<list dataprovider={pdfArray} labelField="docName"/>
</viewStack>
All the pdfs are present on the server and are downloaded to
mydocuments folder
at the creationcomplete of the application.But suppose if my backend
(PHP)
sends me name of pdf which is not physically present on the server and
since
its not present on server it would be not downloaded.The names of pdf
are displayed on the list control.if i click on a pdf name in the list
which is present on the sever and which is downloaded(all of thm get
downloaded that i have checked fully)the pdf will be opened.But if a
pdf is not present and hence not downloaded the canvas in which the
pdf is displayed still shows the previos pdf.Removechild ffrom canvas
is not working and due to memory leak problem i am using pdf =
null.Can u please tell me how to remove an htmlloadercomponent in
situations like this?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---