dcsimg
A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: Image won't disapear

  1. #1
    Junior Member
    Join Date
    Jul 2009
    Posts
    5

    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.

  2. #2
    rabid_Delineator AttackRabbit's Avatar
    Join Date
    Dec 2003
    Location
    Orlando, Florida
    Posts
    481
    yes post code please. Reason being , it would be helpful to see how you are loading and managing that sub .swf.

  3. #3
    Junior Member
    Join Date
    Jul 2009
    Posts
    5
    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...
    Last edited by Infinity Unit; 07-03-2009 at 10:40 AM.

  4. #4
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    Well, by posting your code you've taken the first step towards getting better answers: having your thread moved to a relevant forum.

  5. #5
    Pixel Artéést chriso20's Avatar
    Join Date
    Apr 2003
    Location
    Notts, UK
    Posts
    325
    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?

  6. #6
    Junior Member
    Join Date
    Jul 2009
    Posts
    5
    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.

  7. #7
    Pixel Artéést chriso20's Avatar
    Join Date
    Apr 2003
    Location
    Notts, UK
    Posts
    325
    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.

  8. #8
    Junior Member
    Join Date
    Jul 2009
    Posts
    5
    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

  9. #9
    Pixel Artéést chriso20's Avatar
    Join Date
    Apr 2003
    Location
    Notts, UK
    Posts
    325
    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!
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center