Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...

smeagol16

Members
  • Posts

    16
  • Joined

  • Last visited

smeagol16's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Thank you for your support. Now i understand what's happening, but sitll dont know how/ or where should i put that code and what write in dispose function. Each video swf (one.swf, two.swf..) should have it inside? or in my main swf? Thanks again
  2. Hey every one! I got one little problem. im loading some swf that contains simple video player inside with play and pause btn by: var oneSwf:SWFLoader = new SWFLoader("one.swf", { alpha:0, x:-350, y:-240, container:video_mc, onComplete:completeHandler9}); function completeHandler9(event:LoaderEvent):void { var loadedswf:ContentDisplay = event.target.content; TweenLite.to(loadedswf, 1, {delay:1, alpha:1} ); } with oneSwf.load(); in CLICK function of some mc. I have another mc thats unloads that swf by: TweenLite.delayedCall(0, oneSwf.unload); When i test it via flash everything runs great, video is playing then stops while removing swf, and i can do it over and over. Problems starts when i put that side on my server and want to try same thing. When i load that swf first time i can play video and unload it without any problem, sounds of the movie unloads with swf. But, when i load it again, hit play and want to unload it, the sounds of that movie are still playing... They stops if I again load that swf and unload it. here's the video swf code var nc:NetConnection = new NetConnection(); nc.connect(null); var ns:NetStream = new NetStream(nc); var vid:Video = new Video(640, 360); this.addChild(vid); vid.attachNetStream(ns); vid.y = 60; ns.play("one.flv"); ns.pause(); ns.addEventListener(NetStatusEvent.NET_STATUS, netstat); function netstat(stats:NetStatusEvent) { trace(stats.info.code); } var netClient:Object = new Object(); netClient.onMetaData = function(meta:Object) { trace(meta.duration); }; ns.client = netClient; play_mc.buttonMode = true; pause_mc.buttonMode = true; play_mc.addEventListener(MouseEvent.CLICK, playClick); pause_mc.addEventListener(MouseEvent.CLICK, pauseClick); function playClick(e:MouseEvent):void { ns.resume(); } function pauseClick(e:MouseEvent):void { ns.pause(); } And here's the link when u can see my problem (section Video: ONE) http://www.bonlao.com/annatokarska/ EDIT: i saw that this problem is only when i use play/pause buttons. When i run same swf without buttons with autoplay and im closing it, the sounds stops every time when i unload that swf.
  3. I created two same versions of the sme swf, one in 30FPS and one in 60. And i run them on my core 2 duo notebook and some other old notebook. And Here's the result. 60fps run 100% smooth/30fps is also good but not as 60FPS on my core 2 duo. On older notebook 60FPS is not that smooth, but it still looks better than 30. So i think ill go with 60 anyway, i dont have too much animation, only changing sizes of some rectangles and i think it wont be "old computers killer" Thanks for your reply Carl!
  4. Hi Everyone I'm wondering how many fps should i set on my flash file. At 30 even simple animations like scaling a rectangle runs smooth. But when i set FPS to 60, it looks twice better. Everybody tells that human eye can't see the difference when there is more than 30 FPS, but i see the difference. Even in present PC games, 30FPS looks like **** in compare to 60FPS. So how it goes with use of cpu when while website runs. Is 60 may be too much? I like my project better with 60 fps, but i dont know if its "safe way" to do website. Waiting for any answers, Take care!
  5. As always, Thanks ! That solved my problem
  6. Hi everyone I just got annoying issue (sorry i don't have much to do with tweening ) Every movie clip that is on stage is resize simply by: myclip.x = stage.stageWidth / 2; myclip2.x = stage.stageWidth / 2 + 123; etc. When stage value is 1001px, 1501px etc. all my movie clips gets subpixels and look blurry. Here's the thing http://lz3o4ojdpj2o.az.pl/ef2/ I tried adding .cacheAsBitmap = true; to my movie clips, I also tried to add filters to them. It works on flash preview, but when i publish it and add swffit i got sub-pixels again.. Any help with that? Thanks
  7. Thank you again, When i traced it the targets of the click's was (instance 28, instance 33 etc.) so it was clicking object inside buttons:) mouseChildern = False; resolved it High five!
  8. Hi again. I make changes in my project, now my code in "flash" container looks like this: import com.greensock.TimelineLite; import com.greensock.*; import com.greensock.easing.*; var targetSection:String; var currentSection:String = "kuchnia"; kuchnia_tresc_mc.alpha=0; sypialnia_tresc_mc.alpha=0; salon_tresc_mc.alpha=0; lazienka_tresc_mc.alpha=0; komercyjne_tresc_mc.alpha=0; //kuchnia_mc.alpha=0; sypialnia_mc.alpha=0; salon_mc.alpha=0; lazienka_mc.alpha=0; komercyjne_mc.alpha=0; var timeline:TimelineMax = new TimelineMax({repeat:-1, yoyo:false}); timeline.addLabel("kuchnia_in", timeline.duration); timeline.append(TweenMax.to(kuchnia_mc, 1, {delay:-1, alpha:1})); timeline.append(TweenMax.to(kuchnia_tresc_mc, 2, {delay:-1, alpha:1})); timeline.addLabel("kuchnia_complete", timeline.duration); timeline.append(TweenMax.to(kuchnia_mc, 0.4, {delay:5, alpha:0})); timeline.append(TweenMax.to(kuchnia_tresc_mc, 1, {delay:-1, alpha:0})); timeline.addLabel("sypialnia_in", timeline.duration); timeline.append(TweenMax.to(sypialnia_mc, 1, {delay:-1, alpha:1})); timeline.append(TweenMax.to(sypialnia_tresc_mc, 2, {delay:0, alpha:1})); timeline.addLabel("sypialnia_complete", timeline.duration); timeline.append(TweenMax.to(sypialnia_mc, 0.4, {delay:5, alpha:0})); timeline.append(TweenMax.to(sypialnia_tresc_mc, 1, {delay:-1, alpha:0})); timeline.addLabel("salon_in", timeline.duration); timeline.append(TweenMax.to(salon_mc, 1, {delay:-1, alpha:1})); timeline.append(TweenMax.to(salon_tresc_mc, 2, {delay:0, alpha:1})); timeline.addLabel("salon_complete", timeline.duration); timeline.append(TweenMax.to(salon_mc, 0.4, {delay:5, alpha:0})); timeline.append(TweenMax.to(salon_tresc_mc, 1, {delay:-1, alpha:0})); timeline.addLabel("lazienka_in", timeline.duration); timeline.append(TweenMax.to(lazienka_mc, 1, {delay:-1, alpha:1})); timeline.append(TweenMax.to(lazienka_tresc_mc, 2, {delay:0, alpha:1})); timeline.addLabel("lazienka_complete", timeline.duration); timeline.append(TweenMax.to(lazienka_mc, 0.4, {delay:5, alpha:0})); timeline.append(TweenMax.to(lazienka_tresc_mc, 1, {delay:-1, alpha:0})); timeline.addLabel("komercyjne_in", timeline.duration); timeline.append(TweenMax.to(komercyjne_mc, 1, {delay:-1, alpha:1})); timeline.append(TweenMax.to(komercyjne_tresc_mc, 2, {delay:0, alpha:1})); timeline.addLabel("komercyjne_complete", timeline.duration); timeline.append(TweenMax.to(komercyjne_mc, 0.4, {delay:5, alpha:0})); timeline.append(TweenMax.to(komercyjne_tresc_mc, 1, {delay:-1, alpha:0})); //***************navi nav_mc.addEventListener(MouseEvent.CLICK, onClick); nav_mc.buttonMode = true; nav_mc.useHandCursor = true; nav_mc.kuchnia_btn_mc.ID = "kuchnia"; nav_mc.sypialnia_btn_mc.ID = "sypialnia"; nav_mc.salon_btn_mc.ID = "salon"; nav_mc.lazienka_btn_mc.ID = "lazienka"; nav_mc.komercyjne_btn_mc.ID = "komercyjne"; function onClick(e:MouseEvent):void { trace(e.target.ID); targetSection = e.target.ID; if (targetSection != currentSection) { timeline.gotoAndPlay(targetSection + "_in"); currentSection = targetSection; }else{ trace("you are already at " + currentSection); } } When i try to jump into tween i got message in output that looks like: undefined Error: TimelineLite error: the null_in label was not found. at com.greensock::TimelineLite/parseTimeOrLabel() at com.greensock::TimelineLite/gotoAndPlay() at resizeStage_fla::flash_3/onClick() This is code in main scene: import flash.display.Bitmap; import flash.display.BitmapData; import flash.display.MovieClip; import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.display.Loader; import flash.display.Sprite; import flash.net.URLRequest; import flash.events.Event; import flash.events.MouseEvent; import com.greensock.TimelineLite; import com.greensock.*; import com.greensock.easing.*; if (stage) { init(null); } else { addEventListener(Event.ADDED_TO_STAGE, init); } function init(e:Event):void{ stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; stage.addEventListener(Event.RESIZE, onResize); onResize(null); stage.addEventListener(MouseEvent.MOUSE_MOVE, onMove); } function onResize(e:Event):void { bg_mc.x = stage.stageWidth / 2; // bg_mc.y = 0; logo_mc.x = 30; logo_mc.y = 30; skype_btn.x = stage.stageWidth - 140; skype_btn.y = stage.stageHeight - 50; skype_bg.x = stage.stageWidth - skype_bg.width; skype_bg.y = stage.stageHeight - skype_bg.height; flash_mc.x = stage.stageWidth / 2; flash_mc.y = 110; menu_mc.x = stage.stageWidth - menu_mc.width - 30; menu_mc.y = 50; } function onMove(e:MouseEvent):void { bg_mc.rotationX = e.stageX / 200; bg_mc.rotationY = e.stageY / 200; } Any idea why timeline is looking for null_in instead of kuchnia_in, salon_in etc. ? Thanks for any help!
  9. Thank You for your reply. Your suggestions help me alot, now i understand Tween's more and i i can easly end my project:) That helped me also in understand other things related with Tweening. p.s snorkl.tv next to greensock.com is a cool website, i was learning basics about Loadermax from it. Thanks again
  10. Hi I am huge fan of GreenSock but i'm also a huge beginner. I have a component called "flash" in my website, that contains 5 jpg files, one inside fla and the other 4 loaded by LoaderMax. I've created an animation that switches pictures and some text jpg over and over. Here's the code: import com.greensock.TimelineLite; import com.greensock.*; import com.greensock.easing.*; //kuchnia_tresc_mc.alpha=0; sypialnia_tresc_mc.alpha=0; salon_tresc_mc.alpha=0; lazienka_tresc_mc.alpha=0; komercyjne_tresc_mc.alpha=0; //kuchnia_mc.alpha=0; sypialnia_mc.alpha=0; salon_mc.alpha=0; lazienka_mc.alpha=0; komercyjne_mc.alpha=0; var timeline:TimelineMax = new TimelineMax({repeat:-1, yoyo:false}); timeline.append(TweenMax.to(kuchnia_mc, 0.4, {delay:-1, alpha:1})); timeline.append(TweenMax.to(kuchnia_tresc_mc, 1, {delay:0, alpha:1})); timeline.append(TweenMax.to(kuchnia_mc, 0.4, {delay:7, alpha:0})); timeline.append(TweenMax.to(kuchnia_tresc_mc, 1, {delay:-1, alpha:0})); timeline.append(TweenMax.to(sypialnia_mc, 0.4, {delay:-1, alpha:1})); timeline.append(TweenMax.to(sypialnia_tresc_mc, 1, {delay:0, alpha:1})); timeline.append(TweenMax.to(sypialnia_mc, 0.4, {delay:7, alpha:0})); timeline.append(TweenMax.to(sypialnia_tresc_mc, 1, {delay:-1, alpha:0})); timeline.append(TweenMax.to(salon_mc, 0.4, {delay:-1, alpha:1})); timeline.append(TweenMax.to(salon_tresc_mc, 1, {delay:0, alpha:1})); timeline.append(TweenMax.to(salon_mc, 0.4, {delay:7, alpha:0})); timeline.append(TweenMax.to(salon_tresc_mc, 1, {delay:-1, alpha:0})); timeline.append(TweenMax.to(lazienka_mc, 0.4, {delay:-1, alpha:1})); timeline.append(TweenMax.to(lazienka_tresc_mc, 1, {delay:0, alpha:1})); timeline.append(TweenMax.to(lazienka_mc, 0.4, {delay:7, alpha:0})); timeline.append(TweenMax.to(lazienka_tresc_mc, 1, {delay:-1, alpha:0})); timeline.append(TweenMax.to(komercyjne_mc, 0.4, {delay:-1, alpha:1})); timeline.append(TweenMax.to(komercyjne_tresc_mc, 1, {delay:0, alpha:1})); timeline.append(TweenMax.to(komercyjne_mc, 0.4, {delay:7, alpha:0})); timeline.append(TweenMax.to(komercyjne_tresc_mc, 1, {delay:-1, alpha:0})); I also have 5 MovieClips that are my buttons to switch one of the jpg that i want, but i don't know how to interact them with that tween. With that code in button the .jpg are changing but the tween gets broken. import flash.events.MouseEvent; import flash.display.MovieClip; import com.greensock.TimelineLite; import com.greensock.*; import com.greensock.easing.*; this.buttonMode = true; this.useHandCursor = true; stop(); var p:MovieClip = new MovieClip(); p = MovieClip(parent); function onClick(e:MouseEvent):void { TweenLite.to(p.kuchnia_mc, 1, {alpha:1, ease:Strong.easeOut} ); TweenLite.to(p.sypialnia_mc, 2, {alpha:0, ease:Strong.easeOut} ); TweenLite.to(p.salon_mc, 2, {alpha:0, ease:Strong.easeOut} ); TweenLite.to(p.lazienka_mc, 2, {alpha:0, ease:Strong.easeOut} ); TweenLite.to(p.komercyjne_mc, 2, {alpha:0, ease:Strong.easeOut} ); } function onOver(e:MouseEvent):void { TweenLite.to(kuchnia_mini_mc, 1, {alpha:1, x:0, y:25, ease:Strong.easeOut} ); } function onOut(e:MouseEvent):void { TweenLite.to(kuchnia_mini_mc, 0.5, {alpha:0, x:0, y:-61, ease:Strong.easeIn} ); } this.addEventListener(MouseEvent.CLICK, onClick); this.addEventListener(MouseEvent.MOUSE_OVER, onOver); this.addEventListener(MouseEvent.MOUSE_OUT, onOut); Any idea how to make it right? Here's fla in cs4 (sorry for non-english text in fla) https://rapidshare.com/files/1354915073/test.rar
  11. My bad i wrote last } before tween , not at the last line..(shame) Thank you again!
  12. Thx for your reply:) With your code, Animation stops when window is resized.
  13. Im new in as3 so i dont know it so good for now. So i shoudnt resize my image bg1_mc at onResize() and resize it by using tweens, is that right? How the Tween should look to resize image in the way i done in onResize()? Thank you for more help. function onResize(e:Event):void { bg1_mc.width = stage.stageWidth; bg1_mc.height = stage.stageHeight; ( bg1_mc.scaleX > bg1_mc.scaleY ) ? bg1_mc.scaleY = bg1_mc.scaleX : bg1_mc.scaleX = bg1_mc.scaleY;
×