Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 05-07-2012, 12:27 PM   #1
goanta
Registered User
 
Join Date: May 2012
Posts: 2
Default Help with some coding

I apologies in advance for my lack of knowledge in this area but i would like to know how to chage something that actually sems minute but i can't figure out how to do it.

I got this flash site: frizerie.labute.ro
and I would like it to start off, when it is first loaded, straight to the yellow line without any kind of user input.

here is the action code:


ActionScript Code:
import flash.display.Sprite; import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.events.Event; import caurina.transitions.* stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; stage.addEventListener(Event.RESIZE, resizeHandler); //Tweener.addTween(testmc, {alpha:0, time:3, transition:"linear"}); var cItem:Number = 0; var oItem:Number = 0; var tSw:String = "easeOutQuint"; var tSm:String = "easeOutElastic"; var tIm:Number = 2; var tIm1:Number = 2; var tIm2:Number = 2.1; var tIm3:Number = 2.2; var tIm4:Number = 2.3; var tIm5:Number = 2.4; var tImw:Number = 1.5; var rsthm:Number; var rstsec:Number; var rstcmc:Number; var logg:Number; var logx:Number = 300; //function to change widths of bg rectabgles //oItem function function oItemEdit(){     if (oItem==1){         mBG.Item01.gotoAndStop(1);     }     if (oItem==2){         mBG.Item02.gotoAndStop(1);     }     if (oItem==3){         mBG.Item03.gotoAndStop(1);     }     if (oItem==4){         mBG.Item04.gotoAndStop(1);     }     if (oItem==5){         mBG.Item05.gotoAndStop(1);     } } function animer() {     logg = ((stage.stageHeight / 2) - 300 + (cItem*25));     Tweener.addTween(logo_mc, {y:logg+3, time:tIm, transition:tSm});     Tweener.addTween(message_mc, {y:logg, time:2.2, transition:tSm});     rstsec = (stage.stageHeight / 2) - 300;     rstcmc = ((stage.stageHeight / 2) - 170 + (cItem*25));     Tweener.addTween(mBG, {y:rstsec, time:tIm, transition:tSm});     Tweener.addTween(controls_mc, {x:140, time:1, transition:tSw});     Tweener.addTween(controls_mc, {y:rstcmc, time:tIm4, transition:tSm}); } function changeBG() { // // if(cItem == 1){ //width Tweener.addTween(mBG.Item01, {height:500, time:tImw, transition:tSw}); Tweener.addTween(mBG.Item02, {height:25, time:tImw, transition:tSw}); Tweener.addTween(mBG.Item03, {height:25, time:tImw, transition:tSw}); Tweener.addTween(mBG.Item04, {height:25, time:tImw, transition:tSw}); Tweener.addTween(mBG.Item05, {height:25, time:tImw, transition:tSw}); //x Tweener.addTween(mBG.Item01, {y:0, time:tIm1, transition:tSm}); Tweener.addTween(mBG.Item02, {y:500, time:tIm2, transition:tSm}); Tweener.addTween(mBG.Item03, {y:525, time:tIm3, transition:tSm}); Tweener.addTween(mBG.Item04, {y:550, time:tIm4, transition:tSm}); Tweener.addTween(mBG.Item05, {y:575, time:tIm5, transition:tSm}); // animer(); } if(cItem == 2){ //width Tweener.addTween(mBG.Item01, {height:25, time:tImw, transition:tSw}); Tweener.addTween(mBG.Item02, {height:500, time:tImw, transition:tSw}); Tweener.addTween(mBG.Item03, {height:25, time:tImw, transition:tSw}); Tweener.addTween(mBG.Item04, {height:25, time:tImw, transition:tSw}); Tweener.addTween(mBG.Item05, {height:25, time:tImw, transition:tSw}); // Tweener.addTween(mBG.Item01, {y:0, time:tIm1, transition:tSm}); Tweener.addTween(mBG.Item02, {y:25, time:tIm2, transition:tSm}); Tweener.addTween(mBG.Item03, {y:525, time:tIm3, transition:tSm}); Tweener.addTween(mBG.Item04, {y:550, time:tIm4, transition:tSm}); Tweener.addTween(mBG.Item05, {y:575, time:tIm5, transition:tSm}); // animer(); } if(cItem == 3){ //width Tweener.addTween(mBG.Item01, {height:25, time:tImw, transition:tSw}); Tweener.addTween(mBG.Item02, {height:25, time:tImw, transition:tSw}); Tweener.addTween(mBG.Item03, {height:500, time:tImw, transition:tSw}); Tweener.addTween(mBG.Item04, {height:25, time:tImw, transition:tSw}); Tweener.addTween(mBG.Item05, {height:25, time:tImw, transition:tSw}); //x Tweener.addTween(mBG.Item01, {y:0, time:tIm1, transition:tSm}); Tweener.addTween(mBG.Item02, {y:25, time:tIm2, transition:tSm}); Tweener.addTween(mBG.Item03, {y:50, time:tIm3, transition:tSm}); Tweener.addTween(mBG.Item04, {y:550, time:tIm4, transition:tSm}); Tweener.addTween(mBG.Item05, {y:575, time:tIm5, transition:tSm}); // animer(); } if(cItem == 4){ //width Tweener.addTween(mBG.Item01, {height:25, time:tImw, transition:tSw}); Tweener.addTween(mBG.Item02, {height:25, time:tImw, transition:tSw}); Tweener.addTween(mBG.Item03, {height:25, time:tImw, transition:tSw}); Tweener.addTween(mBG.Item04, {height:500, time:tImw, transition:tSw}); Tweener.addTween(mBG.Item05, {height:25, time:tImw, transition:tSw}); //x Tweener.addTween(mBG.Item01, {y:0, time:tIm1, transition:tSm}); Tweener.addTween(mBG.Item02, {y:25, time:tIm2, transition:tSm}); Tweener.addTween(mBG.Item03, {y:50, time:tIm3, transition:tSm}); Tweener.addTween(mBG.Item04, {y:75, time:tIm4, transition:tSm}); Tweener.addTween(mBG.Item05, {y:575, time:tIm5, transition:tSm}); // animer(); } if(cItem == 5){ //width Tweener.addTween(mBG.Item01, {height:25, time:tImw, transition:tSw}); Tweener.addTween(mBG.Item02, {height:25, time:tImw, transition:tSw}); Tweener.addTween(mBG.Item03, {height:25, time:tImw, transition:tSw}); Tweener.addTween(mBG.Item04, {height:25, time:tImw, transition:tSw}); Tweener.addTween(mBG.Item05, {height:500, time:tImw, transition:tSw}); //x Tweener.addTween(mBG.Item01, {y:0, time:tIm1, transition:tSm}); Tweener.addTween(mBG.Item02, {y:25, time:tIm2, transition:tSm}); Tweener.addTween(mBG.Item03, {y:50, time:tIm3, transition:tSm}); Tweener.addTween(mBG.Item04, {y:75, time:tIm4, transition:tSm}); Tweener.addTween(mBG.Item05, {y:100, time:tIm5, transition:tSm}); // animer(); } if(cItem == 0){ //width if (oItem==1){         mBG.Item01.gotoAndStop(1);     }     if (oItem==2){         mBG.Item02.gotoAndStop(1);     }     if (oItem==3){         mBG.Item03.gotoAndStop(1);     }     if (oItem==4){         mBG.Item04.gotoAndStop(1);     }     if (oItem==5){         mBG.Item05.gotoAndStop(1);     } // Tweener.addTween(mBG.Item01, {height:25, time:tImw, transition:tSw}); Tweener.addTween(mBG.Item02, {height:25, time:tImw, transition:tSw}); Tweener.addTween(mBG.Item03, {height:25, time:tImw, transition:tSw}); Tweener.addTween(mBG.Item04, {height:25, time:tImw, transition:tSw}); Tweener.addTween(mBG.Item05, {height:25, time:tImw, transition:tSw}); //x Tweener.addTween(mBG.Item01, {y:0, time:tIm1, transition:tSm}); Tweener.addTween(mBG.Item02, {y:25, time:tIm2, transition:tSm}); Tweener.addTween(mBG.Item03, {y:50, time:tIm3, transition:tSm}); Tweener.addTween(mBG.Item04, {y:75, time:tIm4, transition:tSm}); Tweener.addTween(mBG.Item05, {y:100, time:tIm5, transition:tSm}); // logg = ((stage.stageHeight / 2) - 65 + (cItem*25)); Tweener.addTween(logo_mc, {y:logg, time:tIm, transition:tSm}); Tweener.addTween(message_mc, {y:logg, time:2.2, transition:tSm}); // rstsec = (stage.stageHeight / 2) - 65; rstcmc = ((stage.stageHeight / 2) - 200 + (cItem*25)); Tweener.addTween(mBG, {y:rstsec, time:tIm, transition:tSm}); Tweener.addTween(controls_mc, {x:-200, time:1, transition:tSw}); } } //This template has been designed and developed by FlashVillage.com //This template has been designed and developed by FlashVillage.com function setBackground() {     var reg2 = stage.stageWidth / 2;     var reg1 = stage.stageHeight / 2;     bg_mc.x = reg2;     bg_mc.y = reg1;     bg_mc.width = stage.stageWidth;     bg_mc.height = stage.stageHeight;     bg_mc.scaleX <= bg_mc.scaleY ? (bg_mc.scaleX = bg_mc.scaleY) : (bg_mc.scaleY = bg_mc.scaleX);     shadow_.y = reg1;     shadow_.x = reg2;     shadow_.width = stage.stageWidth;     shadow_.height = stage.stageHeight;     shadow_.scaleX <= shadow_.scaleY ? (shadow_.scaleX = shadow_.scaleY) : (shadow_.scaleY = shadow_.scaleX);     shadow_.width = stage.stageWidth;     //     mBG.scaleX = stage.stageWidth;     mBG.x = 0;     if(cItem == 0){         rsthm = ((stage.stageHeight / 2) - 65);         Tweener.addTween(mBG, {y:rsthm, time:tIm, transition:tSm});     } else {         Tweener.addTween(mBG, {y:reg1 - 300, time:tIm, transition:tSm});     } } //This template has been designed and developed by FlashVillage.com
goanta is offline   Reply With Quote
Old 05-07-2012, 12:29 PM   #2
goanta
Registered User
 
Join Date: May 2012
Posts: 2
Default

ActionScript Code:
function setPos() {     var lognn:Number = ((stage.stageHeight / 2) - 300 + (cItem*25));     var logy:Number((stage.stageHeight / 2) - 65);     logx =  ((stage.stageWidth / 2) - 250);     //     if(logx>290){     Tweener.addTween(message_mc, {x:logx, time:tIm, transition:tSm});     }else{     Tweener.addTween(message_mc, {x:290, time:tIm, transition:tSm});     }     //     Tweener.addTween(message_mc, {y:lognn, time:tIm, transition:tSm});     if(cItem == 0){         Tweener.addTween(controls_mc, {x:-200, time:tIm, transition:tSm});         logg = ((stage.stageHeight / 2) - 65 + (cItem*25));         Tweener.addTween(logo_mc, {y:logg, time:tIm, transition:tSm});     } else {         controls_mc.x = 140;         var tmpv:Number = ((stage.stageHeight / 2) - 170 + (cItem*25));         Tweener.addTween(controls_mc, {y:tmpv, time:tIm, transition:tSm});         Tweener.addTween(logo_mc, {y:lognn+3, time:tIm, transition:tSm});     }     logo_mc.x = 50; } //set position when stage resizes function resizeHandler(event:Event):void {     setBackground();     setPos(); } //This template has been designed and developed by FlashVillage.com //This template has been designed and developed by FlashVillage.com logo_mc.addEventListener(MouseEvent.CLICK, hmbtn); function hmbtn(Event:MouseEvent):void {     cItem = 0;     changeBG();     message_mc.gotoAndStop(1);     oItem = cItem; } controls_mc.link1_btn.addEventListener(MouseEvent.CLICK, link1); function link1(Event:MouseEvent):void {     cItem = 1;     if(cItem!=oItem){     changeBG();     message_mc.gotoAndPlay("one");     mBG.Item01.gotoAndStop("Hit");     oItemEdit();     oItem = cItem;     } } controls_mc.link2_btn.addEventListener(MouseEvent.CLICK, link2); function link2(Event:MouseEvent):void {     cItem = 2;     if(cItem!=oItem){     changeBG();     message_mc.gotoAndPlay("two");     mBG.Item02.gotoAndStop("Hit");     oItemEdit();     oItem = cItem;     } } controls_mc.link3_btn.addEventListener(MouseEvent.CLICK, link3); function link3(Event:MouseEvent):void {     cItem = 3;     if(cItem!=oItem){     changeBG();     message_mc.gotoAndPlay("three");     mBG.Item03.gotoAndStop("Hit");     oItemEdit();     oItem = cItem;     } } controls_mc.link4_btn.addEventListener(MouseEvent.CLICK, link4); function link4(Event:MouseEvent):void {     cItem = 4;     if(cItem!=oItem){     changeBG();     message_mc.gotoAndPlay("four");     mBG.Item04.gotoAndStop("Hit");     oItemEdit();     oItem = cItem;     } } controls_mc.link5_btn.addEventListener(MouseEvent.CLICK, link5); function link5(Event:MouseEvent):void {     cItem = 5;     if(cItem!=oItem){     changeBG();     message_mc.gotoAndPlay("five");     oItemEdit();     MovieClip(root).mBG.Item05.gotoAndStop("Hit");     oItem = cItem;     } } /// mBG.Item05.ItmB.addEventListener(MouseEvent.MOUSE_OUT, ou5); function ou5(Event:MouseEvent):void {     if(cItem!=5){     mBG.Item05.gotoAndPlay("Out");     } } mBG.Item04.ItmB.addEventListener(MouseEvent.MOUSE_OUT, ou4); function ou4(Event:MouseEvent):void {     if(cItem!=4){     mBG.Item04.gotoAndPlay("Out");     } } mBG.Item03.ItmB.addEventListener(MouseEvent.MOUSE_OUT, ou3); function ou3(Event:MouseEvent):void {     if(cItem!=3){     mBG.Item03.gotoAndPlay("Out");     } } mBG.Item02.ItmB.addEventListener(MouseEvent.MOUSE_OUT, ou2); function ou2(Event:MouseEvent):void {     if(cItem!=2){     mBG.Item02.gotoAndPlay("Out");     } } mBG.Item01.ItmB.addEventListener(MouseEvent.MOUSE_OUT, ou1); function ou1(Event:MouseEvent):void {     if(cItem!=1){     mBG.Item01.gotoAndPlay("Out");     } } /// mBG.Item01.ItmB.addEventListener(MouseEvent.CLICK, link1); mBG.Item02.ItmB.addEventListener(MouseEvent.CLICK, link2); mBG.Item03.ItmB.addEventListener(MouseEvent.CLICK, link3); mBG.Item04.ItmB.addEventListener(MouseEvent.CLICK, link4); mBG.Item05.ItmB.addEventListener(MouseEvent.CLICK, link5); //This template has been designed and developed by FlashVillage.com bg_mc.play(); changeBG(); setPos(); setBackground();


I would really appreciate your help on this. Thank you in advance
goanta is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:59 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.