Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Making .SWFs disappear in replacement for other ones

New Here ,
Mar 16, 2013 Mar 16, 2013

Oooh boy, I feel embarrased coming back here again but...

I was able to get my previous problem sorted out, by doing this:

on (Release) {

loadMovieNum("swfs/epictrance.swf",25);

}

I feel stupid. But now that I have constructed my swf, and have editted the position, I have to ask, is there like a ._visible=false code for foreign .swfs or something? How does one go about making it so choosing another button will remove that .swf, and change it to another. It was bad enough that I was only able to find one guide to importing swfs the way I needed, I doubt there will be one for making them disappear.

Previous discussion:
http://forums.adobe.com/message/5150720#5150720

TOPICS
ActionScript
1.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Mar 17, 2013 Mar 17, 2013

As I said, you need to learn to use the help documents.  Your other response indicated nothing was found... that only indicates you still need to learn how to use them because they contain all of the information you have been asking for.

If you are using loadMovieNum() to load the movie, the compliment for it to unload a movie is unloadMovieNum(). 

You should be cautious in using that particular loading function though, especially in picking a seemingly arbitrary value for the "Num"... you could

...
Translate
Engaged ,
Mar 17, 2013 Mar 17, 2013

I read that other discussion. Ned is right, you really need to learn how to use the documentation for flash. There will be entries for loading or unloading .swf's, it's just often the search terms have to be exact. Search particular books (with relevant book titles) and a relevant keyword and then search something like load, unload or .swf and then search through the list manually.

Google should be a little easier since the search may encompass more words without being exact, however the information is less relevant and you might not find much help without specific search terms.

As for the solution, I do not know I have not loaded and unloaded .swf's before.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 17, 2013 Mar 17, 2013

The books come up with nothing. 'swf' gives nothing. Google doesn't have anything, and if it is there, the key words won't match mine.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 17, 2013 Mar 17, 2013

As I said, you need to learn to use the help documents.  Your other response indicated nothing was found... that only indicates you still need to learn how to use them because they contain all of the information you have been asking for.

If you are using loadMovieNum() to load the movie, the compliment for it to unload a movie is unloadMovieNum(). 

You should be cautious in using that particular loading function though, especially in picking a seemingly arbitrary value for the "Num"... you could be replacing some other content that lives at that level that you don't want to remove.  Sticking with loadMovie will be safer... you just need to find the info for using it.

Also, if you are just starting out coding with Flash, you should break the habit of putting code on objects like you show. Instead, assign instance names to the objects and keep the code in the timeline.  If you were to name the button "loadBtn", then the timeline version of its code would be....

loadBtn.onRelease = function(){

     loadMovieNum("swfs/epictrance.swf",25);

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 17, 2013 Mar 17, 2013

I figured out unloadMovieNum()., and was running over here to tell you. I was too late.

I'll look over your huge message, and try to make sense of it.

loadBtn.onRelease = function(){

     loadMovieNum("swfs/epictrance.swf",25);

}

Yes, I already had that.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 17, 2013 Mar 17, 2013

I do have to say, though, when it says:

Loads a SWF, JPEG, GIF, or PNG file into a movie clip in Flash Player while the original SWF file is playing

I'm not totally aware of what that means. A SWF, into a movie clip?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 17, 2013 Mar 17, 2013

Ignore these last two comments. When working with multiple frames, and multiple buttons which should I use, loadMovie or loadMovieNum? I can' get there to be more than one. I've reviewed the adobe help pages, but they don't seem to be helping.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 22, 2013 Mar 22, 2013

I finally solved it.

I made a new layer called "LoadMovies" and attached the code:

stop();

EpicBTN.onRelease = function(){

     loadMovie("swfs/epictrance.swf",500);

}

And I selected another random button, and I put:

on (release){

unloadMovie(500);

stopAllSounds();

}

500 was a completely random number though, but clicking it, I don't see anything get deleted.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 22, 2013 Mar 22, 2013
LATEST

The loadMovie function does not use a number as the second argument, it loads a SWF, JPEG, GIF, or PNG file into a movie clip. Here is the general form of its use as indicated in the help documents:

loadMovie(url:String, target:Object, [method:String]) : Void     OR

loadMovie(url:String, target:String, [method:String]) : Void

What you appear to be using would be valid for the loadMovieNum function that you were showing earlier which Loads a SWF, JPEG, GIF, or PNG file into a level.

loadMovieNum(url:String, level:Number, [method:String]) : Void

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines