Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Flash Actionscript / July 2008



Tip: Looking for answers? Try searching our database.

I need Flash help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
cenovi - 12 Jul 2008 00:04 GMT
Hello. I am new at Flash so action scripting is not so simple. I have an action
script that is not stopping my clip at the last image and when it starts the
clip, it starts with the last image. Please let me know where I should place
STOP() or can you refer me to someone or someplace where I can get immediate
help.

Please see the attached coding and let me know how I should fix it or what I
should add, I tried placing STOP at the bottom of the coding but it didn't
work. Thank you for your help.
:confused;

Home, my account, search buyers, search sellers, who's online, blogs, forums,
chat rooms, help

NETVEHICLE is a community of car buyers, sellers and enthusiasts where you can
trade vehicles in real time, connect with people and share the same interests

numOfImage = 4;//Number of images
numOfMask = 8;//Number of mask
widthOfMask = 100;//Mask widths
heightOfMask = 240;//Mask heights
numOfRow = 1;//Number of mask row
gap1 = 50;
gap2 = 3000;
current = 2;//First displayed image number
counter = 1;
te = 1;
wmc.createEmptyMovieClip(te, te);
aa = function ()
{
    if (counter <= numOfMask)
    {
        wmc[te].attachMovie("mask", counter, counter);
        wmc[te][counter].image.gotoAndStop(current);
        wmc[te][counter]._x = Math.floor((counter - 1) / numOfRow) *
widthOfMask;
        wmc[te][counter]._y = Math.floor((counter - 1) % numOfRow) *
heightOfMask;
        temp = 1.000000E-001;
        wmc[te][counter].onEnterFrame = function ()
        {
            this.image._x = this.image._x + (-this._x - this.image._x) * temp;
            this.image._y = this.image._y + (-this._y - this.image._y) * temp;
        };
    }
    else
    {
        clearInterval(id);
        id = setInterval(bb, gap2);
    } // end else if
    ++counter;
};
bb = function ()
{
    wmc[te - 1].removeMovieClip();
    ++te;
    wmc.createEmptyMovieClip(te, te);
    if (current == numOfImage)
    {
        current = 1;
    }
    else
    {
        ++current;
    } // end else if
    counter = 1;
    clearInterval(id);
    id = setInterval(aa, gap1);
};
id = setInterval(aa, gap1);
kglad - 12 Jul 2008 00:37 GMT
there are quite a few problems with that code, but to start, why are you calling aa() repeatedly, then bb() repeated, then aa() repeatedly ad infinitum?
cenovi - 12 Jul 2008 00:45 GMT
Hi. The actionscript is from a Flash Mask Effect template that I was asked to
make image and text changes to. I don't know what the repetitive aa and bb
does. The clip works well except that I can not get it to Stop after the last
image, it just keep going and going...

Thanks.
kglad - 12 Jul 2008 00:49 GMT
change bb() to:

bb = function ()
{
    wmc[te - 1].removeMovieClip();
    ++te;
    wmc.createEmptyMovieClip(te, te);
    if (current == numOfImage)
    {
       // current = 1;
    }
    else
    {
        ++current;
 counter = 1;
    clearInterval(id);
    id = setInterval(aa, gap1);
    } // end else if
   
};
cenovi - 12 Jul 2008 02:35 GMT
Thank you so much. Your script stop the clip at the last image but it also stops the mask before the last image so it didn't work too well. However, I really appreciate your help.
kglad - 12 Jul 2008 02:51 GMT
then use your original bb() and try the following for aa():

aa = function ()
{
    if (counter <= numOfMask)
    {
        wmc[te].attachMovie("mask", counter, counter);
        wmc[te][counter].image.gotoAndStop(current);
        wmc[te][counter]._x = Math.floor((counter - 1) / numOfRow) *
widthOfMask;
        wmc[te][counter]._y = Math.floor((counter - 1) % numOfRow) *
heightOfMask;
        temp = 1.000000E-001;
        wmc[te][counter].onEnterFrame = function ()
        {
            this.image._x = this.image._x + (-this._x - this.image._x) * temp;
            this.image._y = this.image._y + (-this._y - this.image._y) * temp;
        };
    }
    else
    {
        clearInterval(id);
if (current< numOfImage){
        id = setInterval(bb, gap2);
}
    } // end else if
    ++counter;
};
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.