Jump to content
Search Community

badkarma911

Members
  • Posts

    5
  • Joined

  • Last visited

badkarma911's Achievements

0

Reputation

  1. Carl, Here I've posted the fla file that uses the external classes to show and hide the map. The visibility of the map is set to off at runtime. When I turn the visibility on and test the project if I click on the map the Tween works and the map is hidden. But I have been unable to get the showMapClass to work. Currently I have no errors and the button mode seems to work but when you click on the Show Map button nothing happens. Once again thanks for your help. MapButtonEC.fla.zip HideMapClass.as.zip ShowMapClass.as.zip
  2. Carl, Thanks a lot, I have tried everything and nothing seems to work. It's probably something very simple but after two weeks I've ran out of possible solutions. Ive attached the fla file and the the document class (both zipped). I have been able to get it to work using the Document Class. It's the external classes that I have the issue with. I'll post them in a moment. Thanks again for all your help. MapButton.fla.zip MapButton.as.zip
  3. This is the code I'm using for the ToggleMapOnClass. Thanks again. package { import com.greensock.*; import com.greensock.easing.*; import com.greensock.TweenMax; import flash.display.MovieClip; import flash.events.Event; import flash.events.MouseEvent; import flash.display.Sprite; import StreetMap; public class MapToggleOnClass extends MovieClip { public var streetMap:Sprite; public function MapToggleOnClass() { this.buttonMode = true; this.addEventListener(MouseEvent.CLICK,showMap); } private function showMap(time:Number=0.5) { TweenMax.to(streetMap,time,{y:50,alpha:1}); } } }
  4. Zync, I greatly appreciate your help especially adding the remove event listener, I had forgot about that. I don't think I did a good job of conveying what I'm trying to do. Essentially, I have one button that opens the map up (actually changes the autoAlpha to 1) the object is already on the stage. Then when the user wants to close the map they click on the map itself and it closes. So the map is actually a button. I have been able to do this through the document class but when I use external classes I run into problems. Using the "this" keyword I have been able to make the map tween to 0 in my MapToggleOffClass. The problem seems to be opening the map in the first place. When I click on the button to make the map appear nothing happens. I have an external class linked to the button to open the map. The map symbol instance name is streetMap.At runtime I get the output error of "Error #1009: Cannot access a property or method of a null object reference." I have no idea why this is occurring. Thanks in advance for any help you can provide.
  5. Ok I hoping someone can help me out. I'm relatively new to action script and TweenMax but have learned a lot over the last year. I'm using Flash Professional and I am trying to ease in a map when the map icon is clicked. Once the user is done they click on the map and the map eases out. This is set up by using two external classes names MapToggleOnClass and MapToggleOffClass. I have been successful in doing this from the document class but only partially successful in doing it from an external class. I say partially because I am able to get the ease out function in the MapToggleOffClass to work when the user clicks on the map. However, I have not been able to get the map to ease in when the map icon is clicked. All my symbols are MovieClips. All the instance names are correct and the instances are on the stage. The visibility of the streetMap instance is set to off at runtime. Using a trace statement I know that Flash is detecting when I click on the Map Icon (mapBook) but nothing happens. The symbol StreetMap is linked to the Class of StreetMap and the Base Class of the MapToggleOffClass. The Symbol Map Icon has the instance name of mapBook and has its class linked to the MapToggleOnClass. I know the linkages are correct because of trace statement when I click on the instance of mapBook. The click is registered but the Tween (easeIn) does not occur. The following is my code: package { import com.greensock.*; import com.greensock.easing.*; import com.greensock.TweenMax; import flash.display.MovieClip; import flash.events.Event; import flash.events.MouseEvent; public class MapToggleOffClass extends MovieClip { public function MapToggleOffClass() { this.buttonMode = true; this.addEventListener(MouseEvent.CLICK,hideMap); function hideMap(event:MouseEvent):void { trace("movieClip Instance Name = " + event.target.name); TweenMax.to(event.currentTarget, 1, {autoAlpha:0, ease:Back.easeOut}); } } } } and package { import com.greensock.*; import com.greensock.easing.*; import com.greensock.TweenMax; import flash.display.MovieClip; import flash.events.Event; import flash.events.MouseEvent; import StreetMap; public class MapToggleOnClass extends MovieClip { var streetMap:StreetMap; public function MapToggleOnClass() { streetMap = new StreetMap(); this.buttonMode = true; this.addEventListener(MouseEvent.CLICK,showMap); function showMap(event:MouseEvent):void { trace("The link is working"); TweenMax.to(streetMap, 1, {autoAlpha:1, ease:Back.easeIn}); } } } } The main difference is the easeOut function uses "event.currentTarget" and the easeIn function uses streetMap as the object. One more thing.... in the action script settings I have automatically declare stage instances checked. What am I missing? Any help would be much appreciated. thanks in advance.
×
×
  • Create New...