load / unload ?

Publishing Flash documents by embedding them in Flash movies
clardic
Posts: 11
Joined: Mon Nov 17, 2008 9:27 am

load / unload ?

Post by clardic » Mon Nov 17, 2008 9:59 am

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

clardic
Posts: 11
Joined: Mon Nov 17, 2008 9:27 am

unload / uninit

Post by clardic » Mon Nov 17, 2008 10:47 am

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

staff
Posts: 281
Joined: Sat Dec 15, 2007 4:48 pm

Re: load / unload ?

Post by staff » Tue Nov 18, 2008 4:51 pm

To properly unload a document, you need to call uninit method on the document reference like this:

Code: Select all

p2f.uninit()

clardic
Posts: 11
Joined: Mon Nov 17, 2008 9:27 am

Re: load / unload ?

Post by clardic » Fri Nov 21, 2008 10:36 am

Thanks for your reply.
Could you also answer to my first question and the loading of several swf without bugs.

Thansk in advance

frederic

clardic
Posts: 11
Joined: Mon Nov 17, 2008 9:27 am

Re: load / unload ?

Post by clardic » Mon Nov 24, 2008 5:59 pm

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

staff
Posts: 281
Joined: Sat Dec 15, 2007 4:48 pm

Re: load / unload ?

Post by staff » Thu Nov 27, 2008 2:28 pm

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.
Attachments
loader.zip
(81.46 KiB) Downloaded 756 times

clardic
Posts: 11
Joined: Mon Nov 17, 2008 9:27 am

Re: load / unload ?

Post by clardic » Sat Dec 20, 2008 12:26 pm

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

clardic
Posts: 11
Joined: Mon Nov 17, 2008 9:27 am

Re: load / unload ?

Post by clardic » Mon Dec 22, 2008 2:38 pm

: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 !

okoelsch
Posts: 1
Joined: Wed May 11, 2011 8:48 am

Re: load / unload ?

Post by okoelsch » Wed May 11, 2011 8:53 am

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

staff
Posts: 281
Joined: Sat Dec 15, 2007 4:48 pm

Re: load / unload ?

Post by staff » Thu May 12, 2011 12:19 pm

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

Post Reply