I'm trying to use _alpha with the _xmouse to interactively fade a box with the mouse pointer.

Hi guys,
I’m new to Flash sort of but most definitely new to
actionscript and programming in general. I’m hoping someone
can help me with a practice thing I’ve been working on - I
thought this would be easy to start of with but it is prooving very
challenging;
I’m trying to create an image fade on a box when the
mouse is within its borders. Essentially I want to get 0% _alpha on
the left edge of the box and 100% on the right edge and dragging
the mouse over the box in the x coord will interactively raise or
lower the _alpha %.
--see attached code for details--
red_mc is the name of my red box which is 123pixels center of
my stage which is 550. When I first started this it was from an
online tutorial but it was for the entire stage hence my division
by 550 pixels in the changeAlpha function. I need help trying to
control the return values for _xmouse within my box to control the
_alpha property.
Any help would be great. Thanks!
Regards,
Nick.

1) Use getBounds() to determine the actual coordinates the
box takes up. If the box's registration is not in it's upper left
or left, other methods could be flaky.
2) Find the difference between getBounds().xMin and _xmouse
3) Find the percent(from 0 to 1) of the box's width that
difference is(say, a little under half way from left to right, or
.45)
3) Multiple times 100 and that's the alpha
Here:
red_mc.onRollOver = function() {
mouseInterval = setInterval(changeAlpha,10,red_mc);
red_mc.onRollOut = red_mc.onReleaseOutside = function() {
clearInterval(mouseInterval);
function changeAlpha (mc) {
// pass in the MovieClip as an argument, so it's more
flexible
var bounds = mc.getBounds(_root); // find target mc's bounds
on _root
var xDif = _root._xmouse-bounds.xMin; // determine how far
from mc's left bound the mouse is
var percent = xDif/mc._width; // determine what percentage
of the mc the mouse is at
mc._alpha = 100*percent; // max alpha times percent gives
desired alpha
trace(mc._alpha);
updateAfterEvent(); // this forces Flash to redraw,
independent of frame rate
Hope that helps

Similar Messages

  • I've just bought a Macbook Pro 15" and I'm trying to use Photoshop, but the resolution its displaying the images at for 100% are too small. I have to design for the web, so need to be intricate with detail, but I'm finding it adjusts the resolution of the

    I've just bought a Macbook Pro 15" and I'm trying to use Photoshop, but the resolution its displaying the images at for 100% are too small. I have to design for the web, so need to be intricate with detail, but I'm finding it adjusts the resolution of the image right down. (I mean you can see the image clearly, but it's too small to edit). When I look at Safari and see a web page at 100% it's clear, but the same page displayed in Photoshop CC appears 50% of the size (even though it says it's 100%)   If I move the application window to another screen it adjusts it correctly  – leaving all the pallettes, menus and tools correctly sized as they are on the retina display   Is there some way to adjust the way Photoshop CC displays images so it is more consistent with what you actually see?   There doesn't seem to be any answer on the Adobe forum, so hopefully someone here can shed some light.  MacBook Pro with Retina display, 15", OS X Yosemite (10.10.2), Photoshop CC 2014

    I tested both ways. With "open in low resolution" ckecked the size of the images is cool, but it is low-resolution including Photoshop appearance.
    If "open in low resolution" is unckecked the appearance is good but the very small size.
    See the image below. It has 650 x 732 px, 72 dpi. The font of the text "Neste aniversário ..." is with 18pt.

  • I have a new I Pad air and I am trying to use it with a projector and a whiteboard, unfortunately the two are not connecting. Can anyone give me reasons why this might be happening.

    I have a new I Pad air and I am trying to use it with a projector and a whiteboard, unfortunately the two are not connecting. Can anyone give me reasons why this might be happening.

    You can connect via a cable or wireless using an Apple TV.
    http://ipad.about.com/od/iPad_Guide/a/How-To-Connect-Your-Ipad-To-Your-Tv.htm
    Connect an iPad to a Television or Projector
    http://www.everymac.com/systems/apple/ipad/ipad-faq/how-to-connect-ipad-to-tv-te levision-projector.html
    Connecting iPad iPhone or iPod to TV or Projector
    http://www.disabled-world.com/assistivedevices/computer/ipad-tv.php
    iPad Accessories: Connections for a TV or Projector
    http://www.dummies.com/how-to/content/ipad-accessories-connections-for-a-tv-or-p rojector.html
    You may be interested in AirPlay on the Apple TV:
    http://www.apple.com/airplay/
    http://www.apple.com/airplay/
    Alternately, there are Apple Digital AV Adapters for hardwired connections:
    http://support.apple.com/kb/ht4108
    http://support.apple.com/kb/ht4108
     Cheers, Tom

  • HT1338 I am trying to use FaceTime with my partner in Mexico but is not connecting. We do get the call, but it just does not connect. What should I do?

    I am trying to use FaceTime with my partner in Mexico but is not connecting. We do get the call, but it just does not connect. What should I do?

    Try turning off the Firewall in System Preferences > Security & Privacy
    Apple - Support - FaceTime

  • I am trying to use Words with friends on my iphone 5.  How do I get rid of   "Connect to itunes to Use Push Notifications

    I am trying to use Words with friends on my iphone 5.  How do I get rid of   "Connect to itunes to Use Push Notifications

    Reading some older threads from 2012 and 2011 it appears the problem was present even then.  Part of the problem was due to people using multiple or different account id's on the various devices.  In my case, I only have one ID and it is the same on all devices yet the iPhone and iPad are still throwing the same error when I try turning on iTunes Match.  This is very frustrating . . . any help out there?  Thanks.

  • I am trying to use livetype with persian alphabet and it doesn't work. what should I do?

    I am trying to use livetype with persian alphabet and it doesn't work. what should I do?

    There is no more LiveType with Motion 5.  You may want to go to the Final Cut Express forum, as that's the only place it's existed for the last few years.

  • I have a mid 2011 27 inch iMac and a late 2012 mac mini. I am using the 27 inch iMac as the display for the mac mini. I was trying to use bootcamp on the mini but after I started downloading windows I can't get it to display on the iMac.

    I have a mid 2011 27 inch iMac and a late 2012 mac mini. I am using the 27 inch iMac as the display for the mac mini with a thunderbolt cable. I was trying to use bootcamp on the mini but after I started downloading windows I can't get it to display on the iMac.

    Hi there,
    The simplest way is to drag it across wirelessly using the 'Airdrop' application once both computers are near one another. 'Airdrop' can be found near the top, on the left hand side menu, within 'Finder'.
    AJ

  • I bought the Adobe student version of Photoshop and Premiere Elements a few months ago - and now I am trying to use it, and the serial number that I have is incorrect - or it is only the registration number or something? It says I should have been sent an

    I bought the Adobe student version of Photoshop and Premiere Elements a few months ago - and now I am trying to use it, and the serial number that I have is incorrect - or it is only the registration number or something? It says I should have been sent an email with the serial number once the product was registered - But I never received this email. If anyone is able to help me with this issue - that would be great. the registration number is: PEPEP6-5578-6450-8871-9107  I am using a windows based system

    If I were you I would first make sure CS6 was deactivated or signed-out. Then download Adobe's cleaner and remove cc, CS6 and any other creative  application installed including Creative Cloud desktop application.  Then install CS6 and use your CS6  serial number during the install to activate CS6 standard or extended which ever the serial number is for.   CS6 Version 13.0 should the be activated. That level of CS6 is extremely bug ridden so be sure to the use CS6 menu Help>Updates to get CS6 updates.  Windows should update to version 13.0.1.3 Mac to version 13.0.6.  Not Subscription CS6 version 13.1.2...
    Use the CC Cleaner Tool to solve installation problems | CC, CS3-CS6

  • Error when trying to use LogMiner with Oracle 8.1.6.0.0

    Hi everybody,
    I'm trying to use LogMiner with Oracle 8.1.6.0.0. When I execute the following code with SQL*Plus, I have an error.
    BEGIN
    DBMS_LOGMNR.START_LOGMNR
    (options =>
    dbms_logmnr.dict_from_online_catalog);
    END;
    The error displayed by SQL*Plus is:
    PLS-00302: 'DICT_FROM_ONLINE_CATALOG' must be declared.
    Please, how to solve this problem?
    Thanks you in advance for your answers.

    user639304 wrote:
    Hi everybody,
    I'm trying to use LogMiner with Oracle 8.1.6.0.0. When I execute the following code with SQL*Plus, I have an error.
    BEGIN
    DBMS_LOGMNR.START_LOGMNR
    (options =>
    dbms_logmnr.dict_from_online_catalog);
    END;
    The error displayed by SQL*Plus is:
    PLS-00302: 'DICT_FROM_ONLINE_CATALOG' must be declared.
    Please, how to solve this problem?
    Thanks you in advance for your answers.Looking at the 8.1.7 doc set (the oldest available on tahiti) I get no hits when searching for 'dict_from_online_catalog'. Searching the 9.2 doc set turns up a reference. Looks like you are trying to use an option that isn't available in your version of Oracle.

  • I have an apple hdmi adapter i am trying to use it with iphone4 it keeps saying cannot play video not supported??t

    help i have an apple hdmi adapter trying to use it with my iphone4  when i plug it in and go to netflix it plays for a second then says cannot play video not supported???? please help im so frustrated!!!

    Success!! There truly is a light at the end of the tunnel. Apple support really did come through and I am successfully back into my account. Ready to purchase more music. I followed the instructions, with patience I thought I lost, submitted my problem, someone emailed me back within two days and all is now perfect. Thanks again Apple.
    To all the frustrated users out there, don't lose hope!!!

  • Error 4002 when trying to use iMatch with mac

    I have been trying to use iMatch with my mac and I continue to receive error 4002

    user639304 wrote:
    Hi everybody,
    I'm trying to use LogMiner with Oracle 8.1.6.0.0. When I execute the following code with SQL*Plus, I have an error.
    BEGIN
    DBMS_LOGMNR.START_LOGMNR
    (options =>
    dbms_logmnr.dict_from_online_catalog);
    END;
    The error displayed by SQL*Plus is:
    PLS-00302: 'DICT_FROM_ONLINE_CATALOG' must be declared.
    Please, how to solve this problem?
    Thanks you in advance for your answers.Looking at the 8.1.7 doc set (the oldest available on tahiti) I get no hits when searching for 'dict_from_online_catalog'. Searching the 9.2 doc set turns up a reference. Looks like you are trying to use an option that isn't available in your version of Oracle.

  • I am trying to use firefox as the web lauch for citrix ica but when I go to login into remote site - I get the message waiting to find website but it nver finds the website. Has anyone else had this problem?

    I am trying to use firefox as the web lauch for citrix ica client but when I go to login into remote site - I get the message waiting to find website but it nver finds the website. Has anyone else had this problem?
    When I installed firefox, it asked if I wanted to use safari settings and I said yes but I think this might be causing the problem. Safari is no longer compatible with citrix ica client. When I reinstalled firefox it automatically installs the safari info. Does anyone know how to re-install firfox without installing safari info?

    Did anyone ever suggest you reset your PRAM?
    http://docs.info.apple.com/article.html?artnum=2238
    Also might want to try resetting the SMC, although I
    doubt there's an issue there.
    http://docs.info.apple.com/article.html?artnum=304123
    I'm getting tired of people who supposedly know what
    they're doing simply guessing that resinstalling the
    OS might solve the issue. It's like trying to dissect
    a frog with a sledge hammer, and wondering why you
    didn't learn anything about anatomy in the process.
    These sorts of things, although bizarre, should be
    (and probably are) fixable without major surgery.
    Thanks for the suggestion... but I think my first question would be why these parameters would need re-setting? This is a new machine... It has never been shut down hard. It is used at most 10 hours per week... mostly using Office 2004 for MAC. I need to figure this out as I will soon need it as a Cs2/CS3 - Aperture workhorse.
    I too agree that it is best not to use a sledge when a scalpel is needed... but as a novice to the MAC world I may have been misled by Apple support. I seems to have fixed the symptoms ( some) but appears NOT to have addressed the cause... which is what I am after.
    Would TechTool Pro detect a bad HD or RAM?
    Thanks....

  • I am trying to use sites on the internet which require Adobe Flash Player, but when I click on the free download, it says that Apple does not support this application, so I cannot use it.  This stops me viewing quite a few interesting things.  Any ideas?

    I am trying to use sites on the internet which require Adobe Flash Player, and when I click for a free download it says that "it is not available for your device because of restrictions that Apple has put in place".  Any suggestions on how to overcome this?

    Flash is not, and probably never will be, supported on the iPad : http://www.apple.com/hotnews/thoughts-on-flash/ . Plus it would be up to Adobe to make a version of their flash player that works on iOS devices, something which they have never managed to do and which they have now given up on trying to do.
    Browser apps such as Skyfire, iSwifter and Puffin 'work' on some sites, but judging by their reviews not all sites. Also some websites, especially news sites, have their own apps in the App Store, so your could try checking there for your sites (and there is the built-in YouTube app).

  • I have unlocked iphone 5.i tried to use it with tmobile.it shows full network but fails to activate and shows sim invalid.how to make it work?

    i have unlocked iphone 5.i tried to use it with tmobile.it shows full network but fails to activate and shows sim invalid.how to make it work?

    Who was your original carrier; did you call them to ask them to unlock your phone, and are you aware of what their unlock policy is (THey may only unlock for international sims and not US sims

  • Trying to use iMessage but the send button is not highlighted so I cannot send

    I have just upgraded to OS5 and have been trying to use iMessage, however the send button is not highlighted and I cannot send messages?

    That refers to iMovie, not iPhoto, and photos in Events can certainly be shared to Email.
    What email option have you selected? IPhoto? Or some other one?
    Regards
    TD

Maybe you are looking for

  • Is there a way to open a hypertext link in my folio?

    Hi! i have a question: Is there a way to open a hypertext link in my folio with java script commands inside an HTML content of my magazine, so that it uses the browser of the folio, rather than forcing me to leave the app and use an external browser?

  • Steps in case of imported p.o

    PL.TELL ME STEP BY STEP FOR IMPORTED P.O. WHICH VENDOR iHAVE TO ENTER. THANKS NIRUPAMA

  • Application crashes when calling run_report_object , FRM-93652: The runtime process has terminated abnormally

    I got this error when calling report from my form: FRM-93652: The runtime process has terminated abnormally Forms Session ID is WLS FORMS.formsapp.101 Here is the trace dump info : Last Trigger  FORM/BLOCK/FIELD: FRM_ACTIVITY_QUEUE.BLK_ACTIVITY_QUEUE

  • APs not joining

    So today has been a disaster. I have 11 Cisco Aironet APs connected to a Cisco WLC 4402 running 7.0.235.3. When we lost power to the controller over the weekend I only had 8 come back. In the AP join log three of them were saying"Layer 3 discovery re

  • Noob / how to display an image?

    Hello, I'm just trying to display an image thats on my local drive, the class is /src/main.java, and the picture is located at /src/image/flower.jpeg The window appears, but no picture? import java.awt.*; import javax.swing.*; public class Main exten