Using a tweening function as a rollover. Please help me restore functionality!
Ok, I have a movieclip with 3 different tweens applied to it
by a few functions. The first tween happens on rollover and makes
the movieclip a little bigger, the second tween happens on rollout
and makes it smaller. The third tween happens on release and makes
the clip much bigger. However, when the user clicks the movie clip
it deletes all of the rollover/rollout/onrelease commands so that
the user can interact with a swf which is loaded into the mc.
Here's my code so far:
//Tweens//
function grow(who) {
who.onEnterFrame = function() {
if (this._xscale<40) {
this._xscale += 5;
this._yscale += 5;
if (this._xscale == 40 && this._yscale == 40) {
delete this.onEnterFrame;
function shrink(who) {
who.onEnterFrame = function() {
if (this._xscale>16.5) {
this._xscale -= 5;
this._yscale -= 5;
if (this._xscale == 16.5 && this._yscale == 16.5) {
delete this.onEnterFrame;
function growBigger(who) {
who.onEnterFrame = function() {
if (this._xscale<100) {
this._xscale += 5;
this._yscale += 5;
if (this._xscale == 100 && this._yscale == 100) {
delete this.onEnterFrame;
//End Tweens//
loadMovie("preloader.swf", "preloader_mc");
preloader_mc._xscale = 21;
preloader_mc._yscale = 20;
this.onRollOver = function() {
grow(this);
this.onRollOut = function() {
shrink(this);
this.onRelease = function() {
delete onRollOver;
delete onRollOut;
delete onRelease;
_root.MkXpos = _root.touristsMark._x;
_root.MkYpos = _root.touristsMark._y;
_root.pan(_root.mapContainer_mc);
growBigger(this);
_root.mapContainer_mc.map_mc.dragger_mc._visible = false;
_root.drag = false;
All of this works just fine. My only problem is that when the
user exits the loaded swf I want the button to shrink back down and
have its functionality restored. Basically when someone clicks the
exit button on the external swf it runs the shrink(who) function
and shrinks everything back down. I put a line of code into the
shrink function when it checks to see if "who" is at 16.5, which
looked like this:
if (this._xscale == 16.5 && this._yscale == 16.5) {
this.onRollOver = function = () {
grow(this);
delete this.onEnterFrame;
However, that didn't restore the functionality. Any help
would be greatly appreciated! I'm a poor student on a deadline
I'm such a moron. I never put in a trace command to see if
the last line of my shrink command was getting executed. It turns
out the movie doesn't scale perfectly to 16.5 but instead goes to
16.49etcetc. As a result that last line wasn't being executed. Now
everything works. But I was wondering if you guys could think of a
nice way to compartmentalize all of this code, like maybe store it
all in a variable or something, so I can attach it to several
different movie clips?
Similar Messages
-
Please help with some function module
Dear All,
We are trying to get data for excise duties based eg. BED, ECS, SECESS in the PO printout. Can anyone please suggest any function module through which excise duty can be calculated. For condition types other than ED we are using function module CALCULATE_TAX_ITEM. Please help.
Thanks and regards,
AtanuDear All,
We are trying to get data for excise duties based eg. BED, ECS, SECESS in the PO printout. Can anyone please suggest any function module through which excise duty can be calculated. For condition types other than ED we are using function module CALCULATE_TAX_ITEM. Please help.
Thanks and regards,
Atanu -
how to install windows 7 on my macbook pro mid 2009 using usb. right now iam using mavericks 10.9 can any one please help me. I tried to edit plist in boot camp but it went wrong please help me.
Iam new to coding. please help me.try the solution posted by kunu here and report back
https://discussions.apple.com/thread/5105056?tstart=0 -
How to use the LAN NetStream for peer transmission, please help, write a sample code
How to use the LAN NetStream for peer transmission, please help, write a sample code
No reply, I reply, Oh
-
Hi, i have a A1186 Mac Pro 2008 Tower. Im running windows 7 64Bit on it. Im not sure about what version of bootcamp should i use to get the drivers. Someone please help me.
Boot Camp support:
http://www.apple.com/support/bootcamp/
Boot Camp FAQ:
http://support.apple.com/kb/HT5639?viewlocale=en_US -
after updating my Macbook Pro retina display to os x yosemite 10.10.2, the mause and track pad locks, and do not respond especially when using the Mac for a long period, please help, how can I solve this, I do not like feel like in windows, so I paid good money for this mack, I feel calm
Hi Buterem,
I'm sorry to hear you are having issues with your MacBook Pro since your recent Yosemite update. I also apologize, I'm a bit unclear on the exact nature of the issue you are describing. If you are having intermittent but persistent responsiveness issues with your mouse or trackpad, you may want to try using Activity Monitor to see if these incidents correspond to occupied system resources, especially system memory or CPU. You may find the following article helpful:
How to use Activity Monitor - Apple Support
If the entire system hangs or locks up (for example, if the system clock freezes and stops counting up), you may also be experiencing some variety of Kernel Panic. If that is the case, you may also find this article useful:
OS X: When your computer spontaneously restarts or displays "Your computer restarted because of a problem." - Apple Support
Regards,
- Brenden -
i have a ipod touch 2nd generation 8gb 4.2.1 im new to itunes i made a itunes account but it says i need a payment method is there anyway i can use my paypal if not is there a way to not have to use a payment method for itunes store please help ty
Create a NEW account using these instructions. Make sure you follow the instructions. Many do not and if you do not you will not get the None option. You must use an email address that you have not used with Apple before.
Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card
Using those instructions you may also be able to select PayPal if that is allowed in your country. -
Im having problem setting up my Hotmail account, it used to work fine until few days ago. It says ive entered an incorrect username or password which i can sign in fine with them details if i use laptop or safari through the phone, Please help..
I Sugges you to log into your hotmail acc and go to security and password change bit, then you will see two-step verification.. turn that off and you will be able to set it up on your iPhone/iPad or even Mac.
Give your phone a restart before trying to set it up. Thanks -
I have tried downloading applications but it says that my Apple ID has never been used in the apple store??please help!
On the iPod fo to Settings>iTunes and App Stores and sign in and view your ID and verify the payment method is OK. Then try again.
-
I need to select and upload a image and corresponding url from an external website using file upload control in MVC4.
Please help
Latheesh K Contact No:+91-9747369936This forum supports .NET Framework setup.
As your issue appears to have nothing to do with .NET Framework setup, please ask in the MVC forums for best support.
http://forums.asp.net/1146.aspx/1?MVC -
How do i update my camera raw? I can not find the download update I've just brought a new d4s and I'm using the iMac with cs6 version. PLEASE HELP..
The Adobe auto updater is pretty decent in CS6. Just go to the Photoshop Help menu > Updates.
You will be able to update ACR, Photoshop and Bridge right there, if there are in fact updates available. -
I can't use my apple account in my Iphone please help me a message appear said"This ID has not used in the iTunes Store"
Hello, BaraaBa.
Thank you for visiting Apple Support Communities.
This sounds like your Apple ID has not yet been used with the iTunes Store. Here is an article that I would recommend going through when experiencing this issue.
Use your Apple ID with the iTunes Store
Open the latest version of iTunes.
Choose Store > Sign In.
Enter your Apple ID and password and click Sign In.
Click Review when asked to review your information.
Enter your billing information.
Click Continue after you enter your credit card and billing information. You can remove or edit your credit card information at any time. Learn more about updating your iTunes Store account information.
Using an existing Apple ID with the iTunes Store, Mac App Store, and iBooks Store
http://support.apple.com/kb/HT2589
Cheers,
Jason H. -
"this iPhone has used more than 5 apple id's" please help.
I have my friend's iPhone 4 but I have restored the phone, still when I try to log in into iCloud, it gives me an error "this iPhone has used more than 5 apple id's" please help.
You think you are logging into icloud, but the error you get indicates that you are trying to create a new account. Since each device has a limit to the number of ID it can create (you seem to have reached that limit), then IF you are trying to create a new account, you'll have to use a different device or computer to do that. Otherwise you are not entering an ID to an existing icloud account.
-
I was not using the cellular data on my Ipad, yesterday I reset my account to start using it again but i can't, please help!!!!!!
I was going to say either that or to remove the email from your email account settings(on ipad) and put it back on. Happens everytime im forced to change my work email password. I need to delete the account and add it again for it to accept the new password.
-
Hi Guys,
Can I use Nokia Bluetooth Headset with iphone 4, please help me out.
Regards
ParveenHi sausage,
Unless you can find out the Apple ID and password of the previous owner, there is nothing you can do to remove the previous user's information. Return it for a refund.
Sorry,
GB
Maybe you are looking for
-
Hi SAP Gurus, I would like to inquire what particular table in SAP R/3 that can display list of planning version created for a specific material and plant using data element VRSIO. Planning version is created in tcode MC93 Thanks, Patrick
-
Adding selection parameter in VF04 selection screen
Hi Gurus... I need to add a selection parameter on selection screen of VF04 transaction. Is it possible to do so? If yes, please tell me how. Thanks.
-
Which class, Spring Framework or Web Aervices with Java?
So, I hope it's okay to post this type of question here. I'm trying to figure out which would be better to take, a 4-day course from SpringSource on the core capabilities of the Spring Framework, or a 4-day course on building web services with Java?
-
I purchased a KDL-50EX645 Bravia TV a little over 2 years ago. My wife and I rarely watch more than 8 hours per week. Several weeks ago it wouldn't turn on and I took it to the local authorized Sony repair office and they told me that there was a sho
-
Can I edit Keynote Template?
I use Keynote 08 to create flash banners for my websites. I want to use one of the templates for a particular banner but it has some elements in it that I don't want. Is there a way I can make that template editable so I can remove two of the graphic