Jump to content
Sign in to follow this  
|!|

[problem]Onemogucavanje dugmeta kad se risajzuje stejdz

Recommended Posts

Pozdrav :)

 

Problem je sledeci:

Napravim event za dugme za over, out i click, i sve lepo radi dok ne risajzujem prozor i onda nece uopste da pozove funkcije za evente :blink: Takodje imam i event za risajzovanje stejdza tj pozicioniranje objekata na sceni pa jel moguce da ima neki konflikt izmedju funkcija :S Kako da resim ovo? AS3 je u pitanju

 

btn.addEventListener(MouseEvent.ROLL_OVER, btnOver);
btn.addEventListener(MouseEvent.ROLL_OUT, btnOut);

function btnOver(e:MouseEvent):void
{
   Tweener.addTween(btn.uS, {scaleX:1, time:0.5, transition:"easeOutCubic"});
}
function btnOut(e:MouseEvent):void
{
   Tweener.addTween(btn.uS, {scaleX:0, time:0.5, transition:"easeOutCubic"});
}

Share this post


Link to post
Share on other sites

Evo kod i za resize

 

import flash.display.StageScaleMode;
import flash.display.StageAlign;

stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.addEventListener(Event.RESIZE, stageResize);

function stageResize(e:Event):void
{
pozicioniranje();
}

function pozicioniranje():void
{
var sw = stage.stageWidth;
var sh = stage.stageHeight;

btn.x=sw;
pozadina.x=0;
pozadina.y=0;
pozadina.width=sw;
pozadina.height=sh;
}

pozicioniranje();

 

Pritom dobijam sledeci error ali resize ne pravi probleme, radi normalno:

 

TypeError: Error #1009: Cannot access a property or method of a null object reference.

at index_fla::MainTimeline/pozicioniranje()

at index_fla::MainTimeline/pozicioniranje()

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...