Jump to content
Search Community

Seasonss

Members
  • Posts

    12
  • Joined

  • Last visited

Seasonss's Achievements

0

Reputation

  1. Super! Thanks once again Carl. I'll have a look at the documentation and see if I can wrap my head around it
  2. Hi everyone, I had my school project setup with the regular flash swf loaders, but some of my files are setup in such a way where suppose I am loading about.swf in main.swf then about.swf is also loading abc.swf, so sometimes while loading it doesn't go to alpha = 1 and just shows up on half opacity. Anyway in a desperate time like this I am turning once again to greensock. This is what I have setup right now. //Loader files to load SWF files into the main file var SWFLoader:Loader = new Loader(); var preLoader:preLoad_mc = new preLoad_mc(); //using our loader to load an external file function loadFile(filePath:String) { currentPage = filePath; addChild(preLoader); preLoader.x = 400; preLoader.y = 350; SWFLoader.load(new URLRequest(filePath)); SWFLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,progInfo); SWFLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,finishLoad); } function progInfo(event:ProgressEvent):void { var percent:Number = Math.round(event.bytesLoaded/event.bytesTotal * 100); preLoader.load_text.text = percent + "%"; preLoader.prog_bar.scaleX = percent/100; } function finishLoad(event:Event):void { SWFLoader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS,progInfo); SWFLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE,finishLoad); removeChild(preLoader); load_area_mc.addChild(SWFLoader); var swfTween = new Tween(load_area_mc,"alpha",None.easeOut,0,1,0.25,true); } /* ----------- Menu ---------------- */ about_btn.addEventListener(MouseEvent.CLICK, goAbout); function goAbout(e:MouseEvent):void{ loadFile("about.swf"); } What is the easiest way to get this working in using loadermax? and in the about.fla I will use a similar code to load the abc.swf? Also, does loadermax have it's own preloader animation? that will work too, cos I am not that worried about how the animation shows as long as it gives a percentage. I tried to understand the tutorials, but not sure if it will work the same way for swfs instead of images, so decided to ask here. Thank you so much.
  3. Tweenlite rotation made life so much easier! http://www.vedamatics.com Thank you to everyone who helped me out here
  4. Hi I have a movieclip called square_mc. I want this movieclip to move up 10 px every time a next button is clicked and down 10 px every time a prev button is clicked. How can I achieve that? TweenLite.to(mc, 1, {y:117}); Normally without a tween I would do like this, but this does not animate, just moves the movieclip to a y position but it's incremental. right.addEventListener(MouseEvent.CLICK, fl_ClickToGoToNextFrame); function fl_ClickToGoToNextFrame(event:MouseEvent):void { nextFrame(); square_mc.y -= 8; }
  5. This might be a very basic question, but I wanted to know that if I wanted to move a mc by say 100 px every time a button was clicked. how would I do that? TweenLite.to(list_mc, 0.75, {x:15}); This would move a mc only once to x = 15 right? Basically I have two buttons left and right and I want list_mc to move a certain number of pixels when either one is clicked in left and right directions respectively. Thank you
  6. Aww Thank you I know how frustrating it is to go through a code to solve a problem and be forced to view bits of the code that have no relation to the problem so I cleared out the rest of the code and stage to make sure that only the problem is prominent Just a syntax error huh. Thank you so much, I can't wait to finish my site and then submit an official link here. Regards
  7. I tried the linear easing but I don't think I am getting the right effect of equal speed. I have attached the fla zipped. I am not sure if keeping it 12 fps will make sure that the animation will be carried out in 60 seconds? Thank you
  8. From what I see the speed for shortRotation changes towards the end (getting slower.) I am trying to animate a sort of a timer that rotates 360degrees in 60 seconds. How can I get it to rotate at the same speed throughout? Or am I just imagining that it gets slower TweenMax.to(timer_mc, 60, {shortRotation:{rotation:-360}}); Thank you
  9. Wow this works perfectly well ( minus the tween) But my main aim is to get a smooth animation and that works! Thank you so much.
  10. Uploaded with ImageShack.us Sorry that I wasn't clear enough. I have attached an image of the navigation menu I am creating. The triangle is the floater_mc and clicking on each menu would make the triangle move to it along the curve. I worked on the code yesterday and updated it to add if and else statements based on which menu it is at and which one it has to go to. import com.greensock.TweenLite; import com.greensock.easing.Cubic; import com.greensock.plugins.TweenPlugin; import com.greensock.plugins.BezierPlugin; TweenPlugin.activate([bezierPlugin]); //activation is permanent in the SWF, so this line only needs to be run once. about_btn.addEventListener(MouseEvent.CLICK, goAbout); history_btn.addEventListener(MouseEvent.CLICK, goOld); sutras_btn.addEventListener(MouseEvent.CLICK, goAbc); tutorials_btn.addEventListener(MouseEvent.CLICK, goTutorials); quiz_btn.addEventListener(MouseEvent.CLICK, goGame); function goAbout(e:MouseEvent):void{ if (floater_mc.x == 315, floater_mc.y == 612) {//at Old TweenLite.to(floater_mc, 3, {bezier:[{x:315, y:612}, {x:214, y:577}], orientToBezier:true, ease:Cubic.easeInOut}); } else if (floater_mc.x == 430, floater_mc.y == 628) {//at Abc TweenLite.to(floater_mc, 3, {bezier:[{x:430, y:628}, {x:315, y:612}, {x:214, y:577}], orientToBezier:true, ease:Cubic.easeInOut}); } else if (floater_mc.x == 554, floater_mc.y == 615) {// at tutorials TweenLite.to(floater_mc, 3, {bezier:[{x:554, y:615}, {x:430, y:628}, {x:315, y:612}, {x:214, y:577}], orientToBezier:true, ease:Cubic.easeInOut}); } else if ( floater_mc.x == 670, floater_mc.y == 580) {//at game TweenLite.to(floater_mc, 3, {bezier:[{x:670, y:580}, {x:554, y:615}, {x:430, y:628}, {x:315, y:612}, {x:214, y:577}], orientToBezier:true, ease:Cubic.easeInOut}); } } function goHistory(e:MouseEvent):void{ //TweenLite.to(floater_mc, 3, {bezier:[{x:214, y:577}, {x:315, y:612}, {x:430, y:628}, {x:554, y:615}, {x:670, y:580}], orientToBezier:true, ease:Cubic.easeInOut}); if (floater_mc.x == 214, floater_mc.y == 577) {//about TweenLite.to(floater_mc, 3, {bezier:[{x:214, y:577}, {x:315, y:612}], orientToBezier:true, ease:Cubic.easeInOut}); } else if (floater_mc.x == 430, floater_mc.y == 628) {//sutras TweenLite.to(floater_mc, 3, {bezier:[{x:430, y:628}, {x:214, y:577}, {x:315, y:612}], orientToBezier:true, ease:Cubic.easeInOut}); } else if (floater_mc.x == 554, floater_mc.y == 615) {//tutorials TweenLite.to(floater_mc, 3, {bezier:[{x:554, y:615}, {x:430, y:628}, {x:214, y:577}, {x:315, y:612}], orientToBezier:true, ease:Cubic.easeInOut}); } else if ( floater_mc.x == 670, floater_mc.y == 580) {//quiz TweenLite.to(floater_mc, 3, {bezier:[{x:554, y:615}, {x:430, y:628}, {x:315, y:612}], orientToBezier:true, ease:Cubic.easeInOut}); } } function goSutras(e:MouseEvent):void{ TweenLite.to(floater_mc, 3, {bezier:[{x:214, y:577}, {x:315, y:612}, {x:430, y:628}, /*{x:554, y:615}, {x:670, y:580}*/], orientToBezier:true, ease:Cubic.easeInOut}); } function goTutorials(e:MouseEvent):void{ TweenLite.to(floater_mc, 3, {bezier:[{x:214, y:577}, {x:315, y:612}, {x:430, y:628}, {x:554, y:615}, /*{x:670, y:580}*/], orientToBezier:true, ease:Cubic.easeInOut}); } function goQuiz(e:MouseEvent):void{ TweenLite.to(floater_mc, 3, {bezier:[{x:214, y:577}, {x:315, y:612}, {x:430, y:628}, {x:554, y:615}, {x:670, y:580}], orientToBezier:true, ease:Cubic.easeInOut}); } I haven't put if else statements for all as yet, but what is happening now is that when I click on Game it goes smoothly, but after that if I click on About the triangle flips upside down and goes to About. I don't understand why the flip happens. Thank you for all your help
  11. I am trying to create a sort of a curved menu and found Greensock online and this makes like soooooooooooo much easier The navigation menu is slightly curved with 5 menus. This is what I have been trying to code. Just the bezier points work great and my floater_mc which is an arrow works well. But for a navigation menu I need it to go from say about to tutorials and then from tutorials back to About or to game on the same path, so I thought of putting if and else statements. Make sense? import com.greensock.TweenLite; import com.greensock.easing.Cubic; import com.greensock.plugins.TweenPlugin; import com.greensock.plugins.BezierPlugin; TweenPlugin.activate([bezierPlugin]); //activation is permanent in the SWF, so this line only needs to be run once. about_btn.addEventListener(MouseEvent.CLICK, goAbout); old_btn.addEventListener(MouseEvent.CLICK, goOld); abc_btn.addEventListener(MouseEvent.CLICK, goAbc); tutorials_btn.addEventListener(MouseEvent.CLICK, goTutorials); game_btn.addEventListener(MouseEvent.CLICK, goGame); function goAbout(e:MouseEvent):void{ if (x == 315,y == 612) { TweenLite.to(floater_mc, 3, {bezier:[{x:315, y:612}, {x:214, y:577}], orientToBezier:true, ease:Cubic.easeInOut}); } else if (x == 430,y == 628) { TweenLite.to(floater_mc, 3, {bezier:[{x:430, y:628}, {x:315, y:612}, {x:214, y:577}], orientToBezier:true, ease:Cubic.easeInOut}); } else if (x == 554,y == 615) { TweenLite.to(floater_mc, 3, {bezier:[{x:554, y:615}, {x:430, y:628}, {x:315, y:612}, {x:214, y:577}], orientToBezier:true, ease:Cubic.easeInOut}); } else if (x == 670,y == 580) { TweenLite.to(floater_mc, 3, {bezier:[{x:670, y:580}, {x:554, y:615}, {x:430, y:628}, {x:315, y:612}, {x:214, y:577}], orientToBezier:true, ease:Cubic.easeInOut}); } } function goOld(e:MouseEvent):void{ TweenLite.to(floater_mc, 3, {bezier:[{x:214, y:577}, {x:315, y:612}, {x:430, y:628}, {x:554, y:615}, {x:670, y:580}], orientToBezier:true, ease:Cubic.easeInOut}); } function goAbc(e:MouseEvent):void{ TweenLite.to(floater_mc, 3, {bezier:[{x:214, y:577}, {x:315, y:612}, {x:430, y:628}, {x:554, y:615}, {x:670, y:580}], orientToBezier:true, ease:Cubic.easeInOut}); } function goTutorials(e:MouseEvent):void{ TweenLite.to(floater_mc, 3, {bezier:[{x:214, y:577}, {x:315, y:612}, {x:430, y:628}, {x:554, y:615}, {x:670, y:580}], orientToBezier:true, ease:Cubic.easeInOut}); } function goGame(e:MouseEvent):void{ TweenLite.to(floater_mc, 3, {bezier:[{x:214, y:577}, {x:315, y:612}, {x:430, y:628}, {x:554, y:615}, {x:670, y:580}], orientToBezier:true, ease:Cubic.easeInOut}); } Is this the right way to go about it?
×
×
  • Create New...