GIGJ.COM
welcome to my space
X
Search:  
Personal Injury | Languages | Soups | Photography | Email | Prepress | Exotic Locations | Computer Games | Related articles
Welcome to:gigj.com
 HOME   Very dumb AS3 question...what happened to Rollovers?

Very dumb AS3 question...what happened to Rollovers?

Published by: mike 2009-01-07

  • To Whom It May Concern.::
    Im very sorry for what is about to happen to you. bye, sk. Labels: Stella Makes you look dumb and makes me look like a jerk when Im forced to just glare
    http://allsuzallthetime.blogspot.com
    HOME
    Ok in as2 i would write it as:

    rect1.onRollOver=function(){
    ...do something
    }

    how do I code this in AS3 now? I am finding it quite hard to adapt to this new code, as2 was easier i think
    FlashMove - BlogSite News flog::
    Which leads to an obvious question -- with Intel-powered iMacs now shipping, and Some impressive, some very dumbmany painful.
    http://www.flashmove.com/blog/index.php?id=13&page=17
    HOME

    Jpixels


  • news_btn.addEventListener(MouseEvent.MOUSE_OVER, rollOver);
    function rollOver(event:MouseEvent):void {
    this.news_btn.gotoAndPlay(2);
    }

    make sure you have the instanceName set on the button.


  • ok thanks, its coz I was messing about with the 'linkage' properties, took them off, now it works!


  • aaaah thank you very much.

    i'm going to be here a lot because I want to make a transition to as3 :)

    I was reading somewhere it said u should always start with package, but a small app I downloaded just had a bunch of listeners and functions...So u dont always need to add that package and extends stuff?

    thanks again


  • I am not trying to hijack this thread, but in the interest of not repeating threads I am going to bud in. I am learning as I go.

    Background:
    My site when you roll over a button will play a quick animation.

    news_btn.addEventListener(MouseEvent.MOUSE_OVER, rollOver);
    function rollOver(evt:MouseEvent):void {
    news_btn.gotoAndPlay(2);
    }

    Now, news_btn is the name of the movie clip that I want to rollover, when they rollover I want to have news_btn leave the first frame in it's own time line and play the animation. I have this code in the first frame of the news_btn movie clip timeline in the actions layer. Eventually when I get this working I will rewind it back to 1 to give it a seemingly flawless animation. But one problem at a time.

    my errors generated were:
    1120: Access of undefined property news_btn. news_btn.gotoAndPlay(2);
    1120: Access of undefined property news_btn.news_btn.addEventListener(MouseEvent.MOUS E_OVER, rollOver);

    I believe i kept it generally the same as you had it, but I am not sure why it is not working. :) any advice would work. I have a feeling it has to do news_btn, but that is the name of the movie clip. I thought I had to be specific which movie clip I want to change frames in or it will change the main clip. should I use .this?


  • rect1.addEventListener(MouseEvent.MOUSE_OVER, rollOverRect);

    function rollOverRect(evt:MouseEvent):void {
    rect1.x=rect1.x+100;
    }

    ok now its saying:

    1046: Type was not found or was not a compile-time constant: rect1.

    any ideas?


  • maybe this is the right place for my question.

    rect1.onRollOver = myfunction(myvar1, myvar2);

    function myfunction(var1, var2) { ... }

    how do i do this one in as3?! passing custom variables to the function i call. not only the event like in
    rect1.addEventListener(MouseEvent.MOUSE_OVER, rollOver);
    function rollOver(evt:MouseEvent):void {
    //do something
    }


  • One question..shouldnt you be using this.x instead of the name of the object?

    thank you


  • In a function, this refers to the object where the function was defined not to the object calling it. So no. You could use the Event object, that is passed to the function, to reference the broadcasting object though (through event.target). This will allow you to use one function for multiple movie clips.

    I don't want to complicate things, but ideally you would create a class for the movie clip which will handle everything internally. This is especially useful if you have multiple instances.


  • What else have you done in your FLA because that code shouldn't throw that error.

    Things like package and extends are for external classes.


  • rect1.addEventListener(MouseEvent.MOUSE_OVER, rollOver);
    function rollOver(evt:MouseEvent):void {
    //do something
    }





  • Nortel Unveils Vision, Strategy for Israeli High-Performance Net
    Busy Friday Leads to Strong Close for Net Stocks

    PRINT Add to favorites
    #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Very dumb AS3 question...what happened to Rollovers? , Please add it free.
  • i need to know this
  • dream about being strangled
  • pokemon pearl sixth pokemon
  • i dream that i was a werewolf and i act like one for months
  • dream analysis can 039 t get it out of my head
  • i had a dream about my face 039 s skin tone changing then my eyes please help 10 pts
  • decoding my dreams
  • joining the dark side is inevitable
  • ideas for an 11 year old girls party
  • dreams when you feel and look beautiful and great
  • anyone know where i can find interpretations on dreams
  • my mom had a dream about me dying in a car accident can some one interpret this for me
  • dream question
  • dreams about satanism
  • what does this dream meen
  •  
  • is it normal to have same set of dreams every 2 years
  • mother see 039 s son die in a car accident
  • dream interpretation pretty disturbing about walking on broken glass
  • how good is a used v1 radar detector
  • lupb
  • when i was a child i used to dream that i 039 m standing in a dark place can 039 t see anything hearing traffic noi
  • how do people get their car to start spinning
  • can someone help me with my nightmare
  • i had this dream so what does it mean
  • sorry other 1 messed up dream
  • nzur
  • ok i had this great dream last night
  • what does this though dream mean
  • blue headlights for g5 gt
  • sskj
  • About us |Contact us |Advertisement |Site map |Exchange links
    Copyright© 2008gigj.com All Rights Reserved