SetInterval or do I need a hit test?

I've a flash piece that uses 6 "houses" (buttons) to display information about mortgage products.  The houses are displayed together in a movie clip that, when rolling over, the user gets a brief description of the product.  I've placed a setInterval to keep the text up for 3000 miliseconds after the cursor leaves a "house".  The problem is after they initially mouseover a house, the onRollover event seems to not hold the text visable.
Code:
on(rollOver){
    clearInterval(timer);
    clearInterval(timer2);
    _root.DisplayText("adjustable");
    _root.DisplayTextBg(1);
on(rollOut){
    clearInterval(timer);
    clearInterval(timer2);
    timer = setInterval(_root.DisplayText,3000);
    timer2 = setInterval(_root.DisplayTextBg,3000);
timer and timer2 are declared on the first frame, and this code is in each button.  The functions for displaying text and the background image are on the first frame:
function DisplayTextBg(fade){
    if (fade==1){
        for (i=0;i<100;i++){
            textBg1._alpha += 1;
    }else{
        textBg1._alpha = 0;
function DisplayText(product){
    //trace(product);
    switch(product){
        case "fixed":
            varLoader.load("fixed.txt");
            break;
        case "adjustable":
            varLoader.load("adjustable.txt");
            break;
        case "possible":
            varLoader.load("homepossible.txt");
            break;
        case "reverse":
            varLoader.load("reverse.txt");
            break;
        case "equity":
            varLoader.load("equity.txt");           
            break;
        case "heloc":
            varLoader.load("heloc.txt");
            break;
        default:
            prodIntro_text.htmlText = "";
            prodTitle_text.htmlText = "";
            //trace("default case");
What should I do to get the rollover to persist after the initial rollout?  Is there a requirement for hit test to make this work?  I clear the interval at all stages, so I'm not sure why this doesn't work.

I'll include the release code for each button as well:
//equity house button code
on(rollOver){
    _root.DisplayText("equity");
    _root.DisplayTextBg(1);
on(rollOut){
    _root.timer=setInterval(_root.DisplayText,3000);
    _root.timer2=setInterval(_root.DisplayTextBg,3000);
on(release){
    // determine location to add movieclip
    var middleX = this._x + 100;
    var middleY = this._y + 359; //existing mc Y
    // reposition the clip    
    _root.attachMovie("equityHouse_mc","equity1",second.getNextHighestDepth(),{_x:middleX,_y: middleY});
    _root.equity1._xscale = 1800;
    _root.equity1._yscale = _root.equity1._xscale;
    mx.transitions.TransitionManager.start(_root.equity1, {type:mx.transitions.Zoom, direction:mx.transitions.Transition.IN, duration:7, easing:mx.transitions.easing.Strong.easeOut});
    _root.houseNumber = 3;
    _root.mcName = "equity1";
    _root.linkageId = "fd6";
    _root.equity1.fadeOut(5);
    _root.gotoAndStop(2);
//heloc house button code
on(rollOver){
    _root.DisplayText("heloc");
    _root.DisplayTextBg(1);
on(rollOut){
    timer=setInterval(_root.DisplayText,3000);
    timer2=setInterval(_root.DisplayTextBg,3000);
on(release){
    // determine location to add movieclip
    var middleX = this._x-200;
    var middleY = 339; //existing mc Y
    // reposition the clip    
    _root.attachMovie("helocHouse_mc","heloc1",second.getNextHighestDepth(),{_x:middleX,_y:mi ddleY});
    _root.heloc1._xscale = 1800;
    _root.heloc1._yscale = _root.heloc1._xscale;
    mx.transitions.TransitionManager.start(_root.heloc1, {type:mx.transitions.Zoom, direction:mx.transitions.Transition.IN, duration:4, easing:mx.transitions.easing.Strong.easeOut});
    _root.houseNumber = 3;
    _root.mcName = "heloc1";
    _root.linkageId = "fd5";
    _root.heloc1.fadeOut(5);
    _root.gotoAndStop(2);
The other 4 buttons mirror this code with the variation being the attachmovie names changed to protect the innocent.
The second frame removes the movie clip with all houses and scales the attached movie clip with a fade at the end
The second frame code is:
function fadeFrame(mc:MovieClip) {
    mc._alpha -= 5;
    if (mc._alpha<=0) {
        mc.alpha = 0;
        gotoAndStop(3);
var faded = setInterval(this, "trans", 1500);
function trans() {
    clearInterval(faded);
    gotoAndStop(3);
Finally, after the movie clip had faded, the third frame is:
import flash.display.BitmapData;
var websort:Number;
var rateFile:String;
var dataLoader:LoadVars = new LoadVars();
removeMovieClip(mcName);
var pName:String = mcName.substr(0,mcName.length - 1);
trace(pName);
    switch(pName){
            case "fixed":
                websort = 1;
                break;
            case "adjustable":
                websort = 11;
                break;
            case "possible":
                websort = 2;
                break;
            case "reverse":
                websort = 3;
                break;
            case "equity":
                websort = 5;
                rateFile = "http://192.168.219.82/equity.asp";
                break;
            case "heloc":
                websort = 6;
                break;
dataLoader.ref = this;
dataLoader.load(rateFile);
var myBitmapData:BitmapData = BitmapData.loadBitmap(linkageId);
//trace(myBitmapData instanceof BitmapData); // true
var mc:MovieClip = this.createEmptyMovieClip("mc", this.getNextHighestDepth());
mc.attachBitmap(this.myBitmapData, mc.getNextHighestDepth());
dataLoader.onLoad = function(success){
    if (success){
        for(var i=0; i<websort; i++){
            //trace(this.ref["cntr"]);
                    this.ref["Terms"].text = this["Terms"+i]
                    this.ref["Points"].text = this["Points"+i]
                    this.ref["Rate"].text = (this["Rate"+i]);
                    this.ref["Apr"].text = (this["Apr"+i]);
                    this.ref["Conditions"].text = (this["Conditions"+i]);
    } else {
        trace("Error loading data");
Which removed the scaled/faded house clip and loads a static image and data related to the product from the database.

Similar Messages

  • AS 3 Object Hit Test question

    I am working on a tennis game. I have designed a two -dimensional court with each of the individual parts of the court (eg right service court) as an instance of a movie clip. I want to distort the court so that the far end looks farther away - the court becomes a trapezium. When detecting whether the ball lands on a particular court section, is the hit test done on the original two-dimensional shape or on the distorted shape?

    unless you use the bitmapdata hittest, you'll be checking for a hit of the bounding rectangle and it does not matter what the original shape is.  if you want a pixel-perfect hittest, you'll need to use the bitmapdata hittest.

  • Need help with testing a package with Junit

    Hi guys,
    I am currently testing a bunch of files under a particular package. I have compiled all the files in this package successfully. I have written a testcase file which is in the folder above the package folder. I am using Junit to test this. I am getting errors stating that Java cannot find the package.
    To explain in detail.....My package name is coinbox which contain some classes which need to be tested. These files are in the folder "coinbox". My testcase file is in the folder which is directly above this folder. My testcase file has the statement import coinbox.* which will import all the classes in the coinbox package;
    But I am getting an error stating that the package coinbox cannot be found. I tried adding the package path to the CLASSPATH variable but still it isnt working.
    The command am using to run the Junit test cases is as follows:
    javac -cp junit.jar;junit.samples.CoinBoxTest-d CoinBoxTest.java
    Any help or suggestions regarding will be appreciated. The coinbox package is not being detected by java.
    Thanks in advance.
    Edited by: calvin_nr on Sep 30, 2007 5:12 PM

    It smells like a classpath problem. Post a sample of the code you are testing, the package statement in particular and the directory structure where the .class files are.

  • HT5858 how do you turn off the need to hit enter once the password is entered

    How do you turn off the need to hit enter once a password is entered?

    Can you try logging on as another administrative user?  (Make another user, if necessary.)
    And just for the heck of it, if you click the lock and unlock the rest of the controls, does the checkbox appear?
    Another thought: is your computer part of a Windows domain or other network?  Is there a policy on the network to require a screen saver password?  (For example on my office's Windows network, a screen saver password requirement is set in the Group Policy.  I'm assuming that something similar can be done with an OSX server, if you haven't joined the Mac to a Windows Active Directory network.)

  • HT1807 how do I make sure to encounter charges for roaming but still use my phone on wifi?  I have viber app and would like to message also without additional charges.  Is there a setting I need to hit to ensure this?

    Travel internationally and use my ipohne with wifi, how do I make sure to avoid charges for roaming but still use my internet and messaging on wifi?  I have viber app and would like to message also without additional charges.  Is there a setting I need to hit to ensure this?

    Settings>General>Network>Roaming>Data Roaming>Off. If you really want to be absolutely certain, Settings>General>Network>Cellular Data>Off.

  • Can i install Adobe Premiere Pro 7 -AND- Premiere CS4 TOGETHER on XP?? NEED THIS FOR TESTS!!

    Hello volks, i have a question.
    I want to install Adobe Premiere 7 AND Adobe Premiere CS 4 TOGETHER on Windows XP.
    I need this for testing somethings.
    Is this possible, or make this more problems i need??
    Thank you a lot for help!
    Best regards
    Wanderer

    Install 7 first and then CS4, otherwise you will run in all kinds of mysterious problems. If you already have CS4 installed, first deactivate, uninstall, run Clean script several times, rebooting in between, install 7, install CS4, activate and run the updates.

  • Need to find test data with payments include earning from past periods

    I am new to Oracle Payroll and need to find test cases which payments include earning from past periods.
    I have an R12.1 Vision environment but cannot run Payroll due to issue with Vertex, but I do have front-end and database access.
    Wonder any Reports/ Forms I can use to locate sample data with earning from past periods?
    Thanks!

    Hi,
    You can use oracle standard form to query old processed payroll for your desired pay periods.
    Navigation is Your HRMS responsibility >View >Payroll Process Results.
    In this you need to choose payroll name,from date,to date and click find.
    for e.g. in your vision instance you can query with payroll as "Vision Monthly" from "12 2008 Calendar Month" to will be "10 2013 Calendar Month" and find the result.
    choose any of the record and view result by further click on Assignment Process button than next click on SOE Report.
    Regards,
    VISHAL DANGI
    Edited by: VISHAL DANGI on Jun 19, 2012 12:50 AM

  • Pixel Perfect Hit Test

    Hey,
    What is the SIMPLEST way to make a pixel perfect hit test class?
    Thanks.

    kglad wrote:
    var enemyH:DisplayObject = getChildByName('enemy_mc') as DisplayObject;
    Thankyou, that fixed that due to me adding the 'new' word in (bad habbit sometimes)
    New Problem
    Source Code Class:
    package
              import flash.display.MovieClip;
              import flash.events.Event;
              import flash.events.MouseEvent;
              import flash.events.TimerEvent;
              import flash.utils.Timer;
              import flash.display.DisplayObject;
              import flash.display.BitmapData;
              import flash.geom.Point;
              import flash.geom.Rectangle;
              public class Main extends MovieClip
                        public var enemyA:Array = [];
                        public var birdA:Array = [];
                        public var MAX_ENEMIES:int = 10;
                        public var gap:int = 100;
                        public var timer:int = 0;
                        public var frame_number:int = 3;
                        public var frame_limit:int = 5;
                        public var time_limit:int = 10;
                        public var TimerSpeed:uint = 1000;
                        public var MyTimer:Timer = new Timer(TimerSpeed);
                        public var TheBird:BirdChar = new BirdChar();
                        public function Main()
                                  // Constructor Code
                        public function activateGameControls()
                                  createEnemyF();
                                  createBirdF();
                                  createLifeF();
                                  createFadeF();
                                  hitTestF();
                                  this.addEventListener(Event.ENTER_FRAME,loopF);
                                  MyTimer.addEventListener(TimerEvent.TIMER,TimerHandler);
                                  MyTimer.start();
                                  frame_number = 3;
                        public function deactivateGameControls()
                                  timer = 0;
                                  addChild(TheBird);
                                  removeChild(TheBird);
                                  this.removeEventListener(Event.ENTER_FRAME,loopF);
                                  MyTimer.removeEventListener(TimerEvent.TIMER,TimerHandler);
                                  if ((getChildByName("enemy_mc") != null))
                                            removeChild(getChildByName("enemy_mc"));
                                  for (var i:int = enemyA.length - 1; i >= 0; i--)
                                            if (enemyA[i].stage)
                                                      enemyA[i].parent.removeChild(enemyA[i]);
                                            enemyA.splice(i,1);
                        public function createLifeF()
                                  var star_one:MovieClip = new star1  ;
                                  var star_two:MovieClip = new star1  ;
                                  var star_three:MovieClip = new star1  ;
                                  addChild(star_one);
                                  addChild(star_two);
                                  addChild(star_three);
                                  star_one.x = 23;
                                  star_one.y = 379.50;
                                  star_two.x = 66;
                                  star_two.y = 379.50;
                                  star_three.x = 108;
                                  star_three.y = 379.50;
                        public function createEnemyF()
                                  for (var i:int = 0; i < MAX_ENEMIES; i++)
                                            var enemy:DisplayObject = new Enemy  ;
                                            enemy.x = Math.random() * stage.stageWidth - enemy.width;
                                            enemy.y =  -  i * (gap + enemy.height) - 30.65;
                                            addChild(enemy);
                                            enemyA.push(enemy);
                                            enemy.name = "enemy_mc";
                        public function createBirdF()
                                  TheBird.x = 270.95;
                                  TheBird.y = 350.95;
                                  birdA.push(TheBird);
                                  addChild(TheBird);
                        public function loopF(event:Event)
                                  updateBirdPositionsF();
                                  updateEnemyPositionsF();
                        public function updateEnemyPositionsF()
                                  for (var i:int = 0; i < enemyA.length; i++)
                                            var enemy:DisplayObject = enemyA[i] as DisplayObject;
                                            enemy.y +=  2;
                        public function hitTestF()
                                  //Create the enemy display object
                                  var enemyH:DisplayObject = getChildByName('enemy_mc') as DisplayObject;
                                  //enemyH Bitmap Data
                                  var enemyRect:Rectangle = enemyH.getBounds(this);
                                  var enemyBitmapData = new BitmapData(enemyH.width,enemyH.height,true,0);
                                  enemyBitmapData.draw(enemyH);
                                  //TheBird Bitmap Data
                                  var birdRect:Rectangle = TheBird.getBounds(this);
                                  var birdBitmapData = new BitmapData(TheBird.width,TheBird.height,true,0);
                                  birdBitmapData.draw(TheBird);
                                  //Bitmap Data Hit Test
                                  if (enemyBitmapData.hitTest(new Point(enemyH.x,enemyH.y), 255, birdBitmapData(new Point(TheBird.x,TheBird.y), 255)))
                                            gotoAndPlay(5);
                                            MyTimer.removeEventListener(TimerEvent.TIMER,TimerHandler);
                                            deactivateGameControls();
                                            if ((getChildByName("enemy_mc") != null))
                                                      removeChild(getChildByName("enemy_mc"));
                        public function updateBirdPositionsF()
                                  TheBird.x = mouseX;
                        public function TimerHandler(event:TimerEvent)
                                  timer +=  1;
                                  if ((timer == time_limit))
                                            MyTimer.removeEventListener(TimerEvent.TIMER,TimerHandler);
                                            frame_number +=  1;
                                            deactivateGameControls();
                                            changeFramesF();
                        public function createFadeF()
                                  var Fading:MovieClip = new FadeEffect  ;
                                  addChild(Fading);
                                  Fading.x = 275;
                                  Fading.y = 200;
                        public function changeFramesF()
                                  if ((frame_number == 4))
                                            gotoAndPlay(4);
                                  else if ((frame_number == 5))
                                            gotoAndPlay(5);
                                  else if ((frame_number == 6))
                                            gotoAndPlay(6);
                                  else if ((frame_number == frame_limit))
                                            trace("All levels have been completed!");
    Error(in debug mode):
    TypeError: Error #1006: value is not a function.
              at Main/hitTestF()
              at Main/activateGameControls()
              at Main/frame3()
              at flash.display::MovieClip/gotoAndPlay()
              at IceMountain_fla::Symbol4_4/frame6()
    Thankyou!

  • Hi I need Apple Hardware test 2.5.2 Apple does'nt have it. Any one on here have a copy or know how I could get access to?Thaks

    hi I need Apple Hardware test 2.5.2 Apple does'nt have it, I orderit it and they no longer carry it so they say. Any one on here have a copy that I could get access to?Thanks

    What model PowerMac do you have? The AHT is on the Install/Restore disc that came with your Mac.
     Cheers, Tom

  • Hit testing without instance names

    I know its possible to hit test From something without an instance name if you have it in a seperate .as file. All you have to do is type in this.hitTest(InstanceName);
    But, Is it possible to do a hit test from something without an instance name against something else that dosent have an instance name?
    this.hitTest(Other);
    And if so is it possible to assign the other object to a variable?
    var Target:Obj;
    Target = this.hitTest(Other);
    these are just my theories as to what the code should look like, Can anyone confirm that its correct, deny that its possible, or show me how it should look? Thanks in advance.

    well, in the beggining of the program there wont even be any hit tests to do. but as the program goes on, later to have to do around 9-10 hit tests per second. as i know that its not what you do, but how many times you do it that slows up a computer, would this effect the programs performance at that rate?
    Date: Fri, 18 Jun 2010 15:27:06 -0600
    From: [email protected]
    To: [email protected]
    Subject: Hit testing without instance names
    if you spawn n objects, you have n*(n-1)/2 hittests to check.  that's the way it is unless you use a technique to decrease that work-load.  and techniques to do just that do exist.
    but in your situation it sounds like you have have 2 or 3 objects to check for hittests which means you only have 1 or 3 hittests to check.
    >

  • Need help with hit.test

    could someone help me. im making a game and i was wondering
    if theres a way to make it if my character walks into somthing it
    goes to a differnet frame

    Okay, there are 2 ways to use hitTest.
    1) Really inaccurate "box-like" hitTest
    2) Point hitTest, semi-accurate
    There is no "perfect" hitTest that can be run only once.
    If you want a crude hitTest, just do:
    if(MAN.hitTest(WALL))
    gotoAndStop(FRAME);
    A warning though:
    If the wall is an L shape, there will be a hitTest even
    though the man is not "touching" the wall. As long as it is within
    a rectangular boundary of the wall, it will be considered "hitting"
    it. Another example is a circle, the man could be along the top
    right corner but not touching the circle.
    The next one is:
    if(WALL.hitTest(MAN.x, MAN.y, true))
    gotoAndStop(FRAME);
    This code is better. However, the man can be "touching" the
    wall and not be "hitting" it. As long as the (x,y) coordinates of
    the man is not touching the wall, the man isn't hitting it.
    The best way I could find (but takes a heck longer) is by
    using two for loops (one with width, one with height) and checks a
    plus sign (+) of coordinates and makes sure that those points are
    touching both the man and the wall to call it a hit.
    Well, I hope this helps!

  • Help needed in e-tester 8.5 its very important now.

    Hi
    i am using eteser 8.5......I need some clarifications on e-tester 8.5. we dont have any knowledge in earlier version i.e 8.4. While doing automation we are facing following problems pls share your info here. we were used QTP earlier but for our client request we are doing some R&D on e-tester.we are getting strucked in some areas.
    we are able to achieve extensibility through following ways i.e
    1) Insert Text matching test checkpoint
    2) we are able add Test Scriplet to each page i.e after page/before page loading. after adding scriplet we are writing small funcions in that scriplet using "*VBSCript*" but sill we are not able to use full functionalities here like we are trying to connect to database using ADODB. but those methods are not supporting in Scriplet.
    My Questions 1) Is there any alternate approch to connect to Database?
    2) How can we implement External programming concept here?
    3) Is there any alternative coding window other than Test Scriplet? If so Where exactly those are available in *8.4 and 8.5 versions*
    4) In all Threads we came to know that 8.4 is using VBA and 8.5 does not have any such type of facility. in 8.4 where we use VBA coding pls show the navigation. Is it in Scriplet or some where else?
    5) I want to Use this tool for automationg SAP application or . NET application do i need any seperate license or add-ins like QTP.
    6) Is current 8.5 is feasable for full automation of a Webapplication. By using 8.5 version can we automate any of our cllent requirement.
    7) how different 8.4 and 8.5 versions
    Anjani

    Oracle quoting is not in OAF, only the print functionality uses these VOs as data source , and are used in the xsl, for XML publisher to generate the quote print .
    1) My HeaderVO, LinesVO and PromptVO are extended, so do i need to extend the links present in that in my new extended VO' s as well.
    Please explain this , what do you mean by extending links ?2) My xsl stylesheet has a statement as
    select values of:....../HeaderVO/HeaderRow/....etc etc
    do i need to replace the above line to my new extended VO i.e
    select values of:....../CustHeaderVO/HeaderRow/...etc etc
    YesThanks
    Tapash

  • Help needed in UAT testing

    Hi
    1) I need to do UAT (User Acceptance testing) for Remapping of  few wage Types (few are secondary wagetypes and few are Customer specific) .How do i do that? .
    2) How to run a G/L wage type report ?
    Regards
    Bill

    Steps:
    1.You need to add information in these WTs, e.g. in IT0014 you could add recurring payments or deduction WTs.
    2. Run payroll
    3. Review the Rumuneration statements to see if your WTs show up or look at the payroll clusters, to see if you see the WTs with the correct payments or deductions
    JR

  • Need to hit Enter after a "silent" install?

    I have been trying to automate a hands free install of 32bit and 64bit versions of the latest 11g client for Windows 2008r2 and Windows 7 64-bit and continue to see a prompt to hit Enter after the install is completed. If I am using the -silent switch then why do I need to interact with the install? Is there a -ReallySilent switch?
    How is anyone automating the deployment of this version of the Oracle Client in Windows?
    This is what I have so far in batch files, using response files I created using the GUI setup.exe method.
    %~dp0win32_11gR2_client\client\setup.exe -ignoreSysPrereqs -silent "ORACLE_HOSTNAME=%computername%" -nowelcome -noconfig -responseFile %~dp0ora11g_x86_client_2.rsp
    %~dp0win64_11gR2_client\client\setup.exe -ignoreSysPrereqs -silent "ORACLE_HOSTNAME=%computername%" -nowelcome -noconfig -responseFile %~dp0ora11g_x64_client_2.rsp
    Any help appreciated
    Thanks
    Edited by: user13517220 on Apr 18, 2012 1:41 PM

    I found via appdeploy.com (now called itninja.com - such a great site!) that I might have better luck with OUI.EXE
    I tried this and it appears to work so far - some of my switches might not be required or redundant though but an extra switch that doesn't break the install is no skin of my nose.
    %~dp0win32_11gR2_client\client\install\oui.exe -waitforcompletion -nowait -force -ignoreSysPrereqs -silent "ORACLE_HOSTNAME=%computername%" -nowelcome -noconfig -responseFile %~dp0ora11g_x86_client_2.rsp
    %~dp0win64_11gR2_client\client\install\oui.exe -waitforcompletion -nowait -force -ignoreSysPrereqs -silent "ORACLE_HOSTNAME=%computername%" -nowelcome -noconfig -responseFile %~dp0ora11g_x64_client_2.rsp

  • Needs maintain Quality testing condition type in order

    Hi,
    There is  a scenario for maintaining the quality testing charges after PGI. in cash sales customer. after they are updating in the invoice. so there is difference in order value and invoice value,
    This difference needs to avoid.
    This condition type (like ZQTC) needs to indicate the user at the time of sales order processing.
    Please help me for configure the same,
    Note: this condition type should be maintained only for Quality testing charges applicable for cash sale customer.
    Thanks and Best regards,
    Muralidharan S
    9841381700.

    resolved by self

Maybe you are looking for