-
Image won't disapear
Hello,
I'm not quite new to actionscript, however I haven't used flash in over 3 years and I am quite rusty. I need a little oil, got some ;)
Ok here's my problem. I'm doing a dynamic slideshow that I access from a main title page.
On the title page, there is a menu with 3 links, including one that loads the slideshow. That link works fine and I can access the slideshow. It displays OK.
In the slideshow, I have a main menu button that is supposed to get me back to the main title page.
The problem is when I click the main menu button. I go back to the title page however the last image of the slideshow won't disapear.
How can I force it to disapear.
I'm using Flash CS3
Tell me if you want me to post my code.
Thanks a bunch
P.
-
yes post code please. Reason being , it would be helpful to see how you are loading and managing that sub .swf.
-
thanks, here it goes :
Code:
// create mc for target
this.createEmptyMovieClip('my_mc', 1);
// start with number 1
var i = 1;
// total number of images/text
var total = 20;
// define the function
function myFunction(i)
{
// load image i:
_root.my_mc._y = 50;
_root.my_mc._x = 350;
my_mc.loadMovie("images/image" + i + ".jpg");
// load text i:
var my_lv = new LoadVars();
my_lv.onLoad = function()
{
my_Txt.html = true;
my_Txt.htmlText = this.myText;
};
my_lv.load("textes/text" + i + ".txt");
}
//
//
//
//
// load first
myFunction(i);
// load next
next_btn.onRelease = function()
{
if (i < total)
{
myFunction(++i);
}
else
{
i = 1;
myFunction(i);
}
};
// load previous
previous_btn.onRelease = function()
{
if (i > 1)
{
myFunction(--i);
}
else
{
i = total;
myFunction(i);
}
};
I forgot to mention that this slideshow was first created in an older version of Flash (MX). I can't quite remember but it seemed to me that it was working fine back then... But it's been too long... I'm not sure anymore...
-
Well, by posting your code you've taken the first step towards getting better answers: having your thread moved to a relevant forum.
-
Now can you post the code that 'goes back to the main menu' or hides your slideshow?
The code you posted doesn't appear to be the problem, and as you stated - this part works fine.
Quick: You could just ._alpha = 0; and ._visible = false; your MC maybe?
-
Hi,
To go back to the main menu (this code is on a button) :
Code:
on (release) {
gotoAndStop("main");
}
Maybe I could add a line in there to hide the MC?
Thanks for you help
P.
-
If the movieClips are dynamically created instead of placed on the stage, they won't disappear as you'd expect.
You'll either have to put them in a placeholder movieClip that was istelf placed on the stage before exporting (/rendering/whatever you call it) or use ._alpha and ._visible as i mentioned previously.
-
Thanks for the reply...
I'm sorry, I think you will have to explain it to me as if I was an Idiot (not that I am, but I'm little slow this time of year :) )
Thanks
-
1 Attachment(s)
Got a little carried away but i hope this helps :) let me know if u need more help.
Sorry if this patronises you lol
File is CS3 compatible. That's the lowest CS4 could go, hope you have it!