How can I prevent children from shrink to infinitesimal values on MouseEvents?

Hello.

I have the following code:

////////////////////////////////////////////////////////////////////////////////////

http://forums.Adobe.com/message/3450898#3450898

property of square_mc.y edited by kglad AND NedMurphy both

but kglad introduced the variable yGap, allowing

space between user-defined video clips.  This solved my

problem of spacing evenly distributed between video clips

all the other code I generated either my own previous

or to think of the solution and work files

at his home.

import flash.display.MovieClip;

import flash.events.Event;

import flash.events.MouseEvent;

var nextY: Number = 0;

var yGap:int = 2;

var container: MovieClip = new MovieClip();

var containerBig:MovieClip = new MovieClip();

containerBig.x = 50;

containerBig.y = 50;

containerBig.scaleX = 1;

containerBig.scaleY = 1;

addChild (container);

addChild (containerBig);

stage.addEventListener (Event.ENTER_FRAME, myFunc);

/ * var imageHolder_mc:MovieClip = new MovieClip();

imageHolder_mc.graphics.beginFill (0 x 888888);

imageHolder_mc.graphics.lineTo (300,0);

imageHolder_mc.graphics.lineTo (300,200);

imageHolder_mc.graphics.lineTo (0.200);

imageHolder_mc.graphics.lineTo (0,0);

*/

var myFrames:Array = new Array();

for (var i: int = 0; i < 12; i ++) {}

myFrames.push ("my_" + i + "_mc");

trace (myFrames + "myFrames");

var square_mc:MovieClip = new MovieClip();

square_mc. Graphics.beginFill (0xFF0000);

square_mc. Graphics.LineTo (200.0);

square_mc. Graphics.LineTo (200,200);

square_mc. Graphics.LineTo (0.200);

square_mc. Graphics.LineTo (0,0);

container.addChild (square_mc);

square_mc. Name = "My_" + i + "_mc";

trace (square_mc. (Name)

square_mc.addEventListener (MouseEvent.MOUSE_OVER, myFunc2);

square_mc.addEventListener (MouseEvent.MOUSE_OUT, myFunc3);

square_mc. ScaleX=.25+(.13*Math.Sin(i/Math.pi)) * mouseY *. 005;

square_mc. ScaleX =. 25;

square_mc. ScaleY = square_mc. ScaleX;

square_mc.Alpha = i *. 1 +. 3;

square_mc.y is nextY + MouseY *(-1);.

nextY += square_mc.height + yGap;

}

function myFunc(e:Event):void {}

Container.y =-1 * mouseY + stage.height;

trace (container.y + "containerY");

}

function myFunc2(e:MouseEvent):void {}

e.target.scaleX * = 1.2;

trace (stage.height + "stageHeight");

e.target.addEventListener (MouseEvent.MOUSE_DOWN, myFunc4);

e.target.mouseChildren = false;

}

function myFunc3(e:MouseEvent):void {}

e.target.scaleX/=1.2;

e.target.removeEventListener (MouseEvent.MOUSE_OVER, myFunc2);

}

Add ImageHolder_mc MovieClip library and go to section

coinciding with the value of table looping for...

var imageHolder_mc:ImageHolder_mc = new ImageHolder_mc();

function myFunc4(e:MouseEvent):void {}

containerBig.addChild (imageHolder_mc);

for (var j: int = 0; j < 12; j ++) {}

{if(e.target.name=="my_"+j+"_mc")}

imageHolder_mc.gotoAndStop (j);

}

}

trace (e.target.y + "e.target.y");

}

////////////////////////////////////////////////////////////////////////////////////

You can solve the problem by adding a frame 12 MovieClip in your library when you test this code and give the name that I've referenced above in bold.

This means that anyone who has the time to help me.

The problem I am facing with is not with the content of the Clip, loading (although I could encounter problems with it later when I try to load dynamic SWF files) because as for now I have just placeholders on images.

I want to know is why my red squares on the left navigation keep getting smaller, as I repeat the MouseOver and mouseout/mouseouthandler() events.  It does not appear that these squares follow the logic of the code the way I wrote it.  The code generated from a previous post with the help of contributors.

Now, I again met a light barrier with the mathematics of coding correctly.  Initially when I tested the code it worked fine without any current "shrinkage".  However, now with more code added the red navigation square do not bounce back to their original countries, they just keep getting smaller.

Can someone help me with this?

Thanking you in advance,

-markerline

import flash.display.MovieClip;

import flash.events.Event;

import flash.events.MouseEvent;

var alreadyExecuted:Boolean;

{if(!alreadyExecuted)}

alreadyExecuted = true;

var nextY: Number = 0;

var yGap:int = 2;

var container: MovieClip = new MovieClip();

var containerBig:MovieClip = new MovieClip();

containerBig.x = 50;

containerBig.y = 50;

containerBig.scaleX = 1;

containerBig.scaleY = 1;

addChild (container);

addChild (containerBig);

stage.addEventListener (Event.ENTER_FRAME, myFunc);

/ * var imageHolder_mc:MovieClip = new MovieClip();

imageHolder_mc.graphics.beginFill (0 x 888888);

imageHolder_mc.graphics.lineTo (300,0);

imageHolder_mc.graphics.lineTo (300,200);

imageHolder_mc.graphics.lineTo (0.200);

imageHolder_mc.graphics.lineTo (0,0);

*/

var myFrames:Array = new Array();

for (var i: int = 0; i<12;>

myFrames.push ("my_" + i + "_mc");

trace (myFrames + "myFrames");

var square_mc:MovieClip = new MovieClip();

square_mc. Graphics.beginFill (0xFF0000);

square_mc. Graphics.LineTo (200.0);

square_mc. Graphics.LineTo (200,200);

square_mc. Graphics.LineTo (0.200);

square_mc. Graphics.LineTo (0,0);

container.addChild (square_mc);

square_mc. Name = "My_" + i + "_mc";

trace (square_mc. (Name)

square_mc.addEventListener (MouseEvent.MOUSE_OVER, myFunc2);

square_mc.addEventListener (MouseEvent.MOUSE_OUT, myFunc3);

square_mc. ScaleX=.25+(.13*Math.Sin(i/Math.pi)) * mouseY *. 005;

square_mc. ScaleX =. 25;

square_mc. ScaleY = square_mc. ScaleX;

square_mc.Alpha = i *. 1 +. 3;

square_mc.y is nextY + MouseY *(-1);.

nextY += square_mc.height + yGap;

}

function myFunc(e:Event):void {}

Container.y =-1 * mouseY + stage.height;

trace (container.y + "containerY");

}

function myFunc2(e:MouseEvent):void {}

e.target.scaleX * = 1.2;

trace (stage.height + "stageHeight");

e.target.addEventListener (MouseEvent.MOUSE_DOWN, myFunc4);

e.target.mouseChildren = false;

}

function myFunc3(e:MouseEvent):void {}

e.target.scaleX/=1.2;

e.target.removeEventListener (MouseEvent.MOUSE_OVER, myFunc2);

}

Add ImageHolder_mc MovieClip library and go to section

coinciding with the value of table looping for...

var imageHolder_mc:ImageHolder_mc = new ImageHolder_mc();

function myFunc4(e:MouseEvent):void {}

containerBig.addChild (imageHolder_mc);

for (var j: int = 0; j<12;>

{if(e.Target.Name=="My_"+j+"_mc")}

imageHolder_mc.gotoAndStop (j);

}

}

trace (e.target.y + "e.target.y");

}

}

Tags: Adobe Animate

Similar Questions

  • How can I prevent updates from any application?

    How can I prevent updates from any application?

    In OS X goto System Preferences > > App Store and a tick "automatically check for updates.

    < image edited by host to remove personal information >

  • How can I prevent word from opening when I boot my Mac?

    How can I prevent word from opening when I boot my Mac?

    It may be something added to the login items in System Preferences > users and groups

    When you shut down the computer, there is also a checkbox asking you if you want to keep the configuration of the application that you have at that time, in which case it will return all open applications.

  • When I use dreamweaver cs6 browser Checker to find pages, it creates another page starting with the letter T. And he added this page to my folder. How can I prevent that from happening. I use a Mac.

    When I use Dreamweaver cs6 browser Checker to find pages, it creates another page starting with the letter T. And he added this page to my folder. How can I prevent that from happening. I use a Mac.

    Are you spotted with temporary files?  In Edition > Preferences > Preview in browser.

    Nancy O.

  • My computer has happened in a power safe mode and I cannot restore without rebooting. How can I prevent this from happening on the Vista operating system?

    My computer suddenly goes into safe mode of power and I am not able to restore in normal mode without rebooting the computer. How can I stop this from happening? My OS is Windows Vista Ultimate 64-bit.

    Thank you

    JO Ann

    Hello

    You should be able to solve this problem by activating the mode Hibernate in the command prompt. If she hibernates, it will save an image where you are on your hard drive and you will be in business once the power returns.
    You must also make sure that your power options would spend in hibernation mode when the power is lower at some point.
    1. Click Start and type 'CMD '.
    2. Right click on CMD and run as administrator.
    3. Click on continue when you are prompted.
    4. "Type in the command prompt" "" powercfg.exe /Hibernate on.
    5. Go to the options to be able to enter the control panel by typing in "Power Options."
    6. You will see the different power options. The one you have selected, that's what you are currently using. Click on "change plan settings".
    7. Click on "change power avancΘs."
    8. Scroll down to the battery and you will see the options of low battery and critical battery responses. Make sure they are set for the hibernation.
    I hope that after these steps, your problems. Please let me know if you have any questions.
  • XP SP3, and Windows Live Mail, when I receive a file .htm as an attachment to an e-mail, it's a file 'blocked '. How can I prevent this from happening.

    Win XP SP3 and Windows Live Mail. I get emails from my office surveillance video. The e-mail has an attachment '.htm '. When I double click the file .htm in the email, it starts Internet Explorer 8 and must upload a short video clip and display it. The fly in the soup seems to be the fact that the .htm file is "locked".

    He can be unlocked by saving it to disk and using Windows Explorer to display its properties, and then click the button "Unblock" - but it's just a "work around".

    From what I read on Microsoft sites, the .htm files are not considered to be dangerous - or are? So why are they blocked? And how do I prevent it?

    I listen carefully!

    Thank you very much Halima, maybe you helped me to focus, in any case I eventually find a switch in Windows Live Mail, which was causing my pain.

    In Windows Live Mail, go to TOOLS-online the SECURITY OPTIONS-online SECURITY => and UNCHECK the line "do not allow opening or saving attachments that could contain a virus.

    Problem solved - thank you for your time and effort.

  • My newly installed TB has disappeared from my computer portable 64-bit Windows 8.1. How can I prevent this from happening again?

    When I installed new cases of tuberculosis 'portable' a few minutes ago, all seemed well unfold. I downloaded an accumulation of messages from my server and started the implementation of filters and the archive folders. Suddenly, TB froze and then disappeared! When I clicked on the icon, I was presented with a blank, new, TB and asked if I wanted a new email address, etc., as I had been before (and refused). I went ahead and download my messages in the 'empty' TB, but how can I keep the content to disappear again?
    I wonder if this is a problem with the wrong Windows 8.1. Any ideas?
    Thank you
    MaxineKL to the Canada that prefer Tbird to Outlook

    The examples I have seen are Windows 8 back to a previous state when something goes wrong with the boot and Thunderbirds gets cancelled out of existence. Creating a restore point in Windows after you install Thunderbird could help.

  • How can I prevent people from seeing where the email has passed since?

    How can I stop showing where email is transmitted from

    How can I stop showing where email is transmitted from

    Select and then delete the addresses in the e-mail message.

    And when you send an email if you do not want your visible list of recipients used the bcc function.

    http://ask-Leo.com/how_does_using_bcc_help_reduce_spam.html

  • How can I prevent videos from website run automatically?

    I run Media Center live and recorded tv in a small window during the visit of my favorite sites.  Many of the websites have articles I want to read as well as the same information in the form of a video (complete with ads).  I would like to know if there is a way to prevent, audio and video on websites to run automatically in Windows 7?  The audio portion of videos runs simultaneously with audio of Media Center what the audio of the two useless.

    I do however sometimes, visit video sites like Hulu and network sites to watch streaming tv shows of old and would need to be able to turn on audio/video on these Web sites.

    What is a setting in Windows or in the browser?  I usually use IE 11 for web browsing, but if there is another browser that offers more control over the audio/video Web sites I could without browsers.

    You can't control that, sorry.  Only the person who programmed the site can decide how the site works.  Or they can give you the control to choose, if they built these options on their Web sites.

  • How can I prevent users from access to my hard drive from backup to the enclosed address?

    I have a HD attached used only for backup. When I change the guest user attached the HD content is accessible. I tried to change the permissions for the disk 'all', using the information, 'no access' window (without blocking) that seemed to make the case, but a quick search gave terrible warnings about changing permissions, so I came back to the unsatisfactory "read only". Change return 'each' to 'No access' would be a bad move.  If so what can restrict the guest access to the HD (besides of course the disconnection of the latter!) attached.

    You can encrypt the back upward, then it will be password protected.

    http://osxdaily.com/2012/09/17/how-to-encrypt-an-external-drive-quickly-in-Mac-o s-x.

  • Using Firefox on portable computer and yahoo links opens up to mobile format. Why I can't open links in normal format, and how can I prevent it from?

    I'm unable to open all the links on yahoo (yahoo example) of my browser firefox in normal format sports stories. When I click on a link to yahoo using firefox it switches to yahoo mobile and if this story is not available on mobile I can't read. I like to use Firefox, but I'm to so annoyed not being able to use yahoo properly I have to stop using it. I have a feeling that it might be an add on because it can't get on my desktop computer at home, but I am usually on my laptop, and want to be able to use yahoo with firefox.

    Create a new profile as a test to see if your profile is the source of the problems.

    See "create a profile":

    If the new profile works then you can transfer files from a profile in the new profile, but be careful not to copy files corrupted to avoid transporting on the problem.

  • How can I prevent users from Apple ID to connect to the server?

    We are a small company that uses a Mac Mini Server. We just clean installed 10.11.4 on new SSD, I installed.

    After you have configured the actions, anyone can connect even when they do not have a username or password and that's because they use the same account as the server iCloud (we do this to keep all calendars, reminders, mail, etc. in sync), but it is automatically all have their connect you to the same user for file shares. I didn't have this problem before. And I certainly don't want anyone logged in as the same user. The guest user is disabled.

    I searched and searched for the answer and found on previous operating system but not El Capitan.

    So, how to disable the connection with Apple ID?

    I found the solution, and I want to share it.

    If you server is under

    Users accounts:

    Then you right-click the user and select advanced options. If you have anything in the alias, which would cause if logging the user with an identifier to Apple. That might be true for all users, not just the one connected locally.

    If you do not have server and you share settings:

    System preferences, then users and groups. Then, you need to unlock downstairs. Then you right-click the user and choose advanced and you options if you have anything in the alias, they could connect without a username and password if they are connected to the appleID already.

    I hope this helps you.

  • When you select the print document, a box comes up to save the document as. How can I prevent this from happening every time?

    I want just the print page, will not record to it anywhere.

    I hope it's just a setting. I can't find to fix on my own. Thank you for your help.

    Sandy

    Depending on your printer, there may be a checkbox in the print dialog box to "print to file". Make sure the box is unchecked.

  • How can I prevent iTunes from bad put new music in a new folder?

    I have a new Windows computer and moved all my music stored in iTunes, which went well.  I had to re-rip CDs (missing songs from a long - ago migration) and I noticed that instead of putting the songs in c:\users\username\music\itunes\itunesmedia, it is now declining these newly ripped songs in a subfolder in iTunes Media appointed, in addition, 'Music' (c:\users\username\music\itunes\itunesmedia\music).  I discovered this when I right click
    Display in Windows Explorer and sees all the music from a CD in a folder.  Records are organized just like in iTunes Media, by artist name and that the mere fact that I know, they are not in one place, they play well.  Still, I would an album to be all in one folder, however.

    Here are my settings/preferences:

    location of iTunes Media is: c:\users\username\music\itunes\itunesmedia

    Maintain organized the iTunes Media folder is not checked

    Copy the files in the iTunes folder when adding to Library Media is verified.

    "I assumed that once when adding new songs, the: copy files to iTunes Media folder" would be my songs on behalf of the artist suitable in iTunes Media, but rather he loses music newly added in a new folder confusingly also named 'music' in iTunes Media.

    Looking for suggestions on setting changes (a computer expert suggested I not check keep iTunes folder Media to keep the best control of my collection, but I wonder if this would solve everything.) In addition, it is a new computer and Windows music player ever has been implemented, so I don't think that there is a problem with both programs clashing.)

    Thx for helping me, Roberta

    I think it's the way iTunes he did for awhile now.

    iTunes 9 [and later]: understanding iTunes Media organization - http://support.apple.com/HT201979 - more information on the Organization of the new structure https://discussions.apple.com/message/26404702#26404702

  • How can I prevent users from leaving a standalone .exe?

    Hello

    I only started using Labview and just made my first stand-alone .exe.

    This software more a device that must operate 24/7 and I don't want anyone to exit it, even by mistake.

    I want to create a "are you sure you want to exit?" or to prevent a release anyway.

    Thank you

    Pini =]

    Sign up for the "Close Application?" and "Front Panel.Close?" events, in these cases put your question and based on the gap of the feedback (disable) the event.

    Tone

Maybe you are looking for