Page 1 of 2

load / unload ?

Posted: Mon Nov 17, 2008 9:59 am
by clardic
Hello
Before to buy the version, we need to be able to load numerous swf in our flash program.
But we have a big problem.

Easy to create a button and load the swf, an other button and an other swf, but after 2 or 3 clicks, nothing appear and we can click on any button without obtain answer ! Need to relaunch the soft !
Is-it a problem of Unload ?
How to Load and Unload a swf file ?
How to know which one is loaded ?
To be clear on button 1

Code: Select all

on (release) {
		var p2f=LoadPrint2FlashDoc("test1.swf", 160,10,630, 485, "test1");
}
To be clear on button 2

Code: Select all

on (release) {
		var p2f=LoadPrint2FlashDoc("test2.swf", 160,10,630, 485, "test2");
}
the rest of the code is on the frame 1

Thanks for your help.

regards

unload / uninit

Posted: Mon Nov 17, 2008 10:47 am
by clardic
Hello

in your help content
i n .. using with as 2

you speak about "uninit", but nowhere I found information about this metod to unload correctly.

Any more information ?

regards

Re: load / unload ?

Posted: Tue Nov 18, 2008 4:51 pm
by staff
To properly unload a document, you need to call uninit method on the document reference like this:

Code: Select all

p2f.uninit()

Re: load / unload ?

Posted: Fri Nov 21, 2008 10:36 am
by clardic
Thanks for your reply.
Could you also answer to my first question and the loading of several swf without bugs.

Thansk in advance

frederic

Re: load / unload ?

Posted: Mon Nov 24, 2008 5:59 pm
by clardic
Hello
My problem stay the same as the begining, and I need to use it and will buy it as soon it will walk.
I load my swf by : (i diden't forget to write all the other code)

Code: Select all

on (release) {
	var p2f=LoadPrint2FlashDoc("pack01.swf", 200,0,600,500, "Doc01");
}
it's ok !
I can load several one with other buttons, but if I make the mistake to click 2 times on a button already used, it becomes bugged !
I tried to unload it with an other button to test it :

Code: Select all

on (release) {
	p2f.uninit("Doc01");
}
No success
Could you explain me what is wrong ?
Thanks
clardic

Re: load / unload ?

Posted: Thu Nov 27, 2008 2:28 pm
by staff
You also need to remove the document movie from the stage like any other movie using removeMovieClip method so your unloading code should look like this:

Code: Select all

p2f.uninit();
p2f.removeMovieClip();
Please see attached to this post the FLA file that demonstrates how to load and unload Print2Flash documents properly.

Re: load / unload ?

Posted: Sat Dec 20, 2008 12:26 pm
by clardic
Hello,
Thanks for the efficient and clear example.
But
Your system works perfectly IF and only IF I cannot manage the position on the layer.
The swf is at the left in the top blocked.
In order to position correctly my loading file in x and y I have to add :

Code: Select all

	container._lockroot=true
in the "startingg code"

The positionning is perfect, but the unload dosn't works.
Do you have an other code to remplace

Code: Select all

container._lockroot=true
Thanks for your support

Re: load / unload ?

Posted: Mon Dec 22, 2008 2:38 pm
by clardic
:lol:

it's ok it's works now !
All problem are solved, your program is right. I'm waiting the update for full personalization of the interface et it will be perfect !

Re: load / unload ?

Posted: Wed May 11, 2011 8:53 am
by okoelsch
Hi,

im starting to work with Print2Flash.
i use AS3 coding as well as AS3 encoded SWFs.
So i need to unload the swfs as well, but i cant find this uninit() method in AS3 class Print2FlashDoc3.

So how can i unload the swf to ensure its being removed from memory with AS3?

Thanks a lot

Oliver

Re: load / unload ?

Posted: Thu May 12, 2011 12:19 pm
by staff
uninit method applies only to AS2 documents. As you load AS3 documents, you need to use the technique described at this help topic: http://print2flash.com/help/UsingDocume ... S3_AS3.php (which says nothing about uninit method).

Print2FlashDoc3 class is a descendant of standard Loader class. To unload AS3 documents, you may use unload or unloadAndStop methods of that class. More information is available here: http://help.adobe.com/en_US/FlashPlatfo ... oader.html