Jump to content
Search Community

Carl last won the day on December 24 2023

Carl had the most liked content!

Carl

Moderators
  • Posts

    9,824
  • Joined

  • Last visited

  • Days Won

    546

Everything posted by Carl

  1. Carl

    fades

    thanks for posting your file. very cool. nice work!
  2. i've never used this method of setting an align mode in the constructor, but according to the documentation you ALSO need to pass in a tweens array into the constructor as well. Align modes set in the constructor don't seem to effect tweens that are later added.
  3. no problem. glad you figured it out. the conflicting swc and source folders must have driven you nuts for a bit!
  4. Carl

    fades

    Sure thing: http://www.snorkl.tv/2010/09/tweenmax-t ... wn-by-now/ http://www.snorkl.tv/2011/01/fade-hide- ... ling-over/ http://www.snorkl.tv/2011/01/inverted-c ... pe-effect/
  5. The easy way to do a gray scale effect would be to use the TweenLite colorMatrixFilter and simply tween to a saturation value of 0 import com.greensock.*; import com.greensock.easing.*; import com.greensock.plugins.*; TweenPlugin.activate([EndArrayPlugin, ColorMatrixFilterPlugin]); TweenMax.to(mc, 1, {colorMatrixFilter:{saturation:0}}); The beauty of this plugin is that it completely hides the complexity of tweening multiple arrays of channel data and repeatedly updating and applying filter settings on your display objects. please see the plugin explorer at http://www.tweenmax.com for an interactive example. if you insist on manually tweening each channel's array of values yourself, take a look at the endArray plugin that will allow you to tween any array of values to your desired end array of values. There is also an example in this in the plugin explorer. *note you will have to create your own onUpdate function that repeatedly creates a new matrix, applies it to your filter, and then applies that filter to your mc. I would definitely opt for spending a few minutes fiddling with the settings in the plugin explorer / colorMatrixFilter or colorTransform and using the generated code.
  6. you were very close. you need each tween in the allTo to repeat and yoyo. timeline.insertMultiple( TweenMax.allTo(slupki, .5, {glowFilter:{color:0xffffff, alpha:1, blurX:30, blurY:30}, repeat:1, yoyo:true}, 1) ); that should work for you.
  7. you described the behavior of a thumbnail fading in (although i assume you meant fade out), and then loading a large image which then animates. your link shows a single image getting bigger when you click on it. the two are quite different in there complexity and scope. furthermore, I don't understand exactly why you are asking how a particular effect is achieved when all the source files for that effect are freely available? http://www.riacodes.com/flash/create-a- ... ith-flash/ From your previous code it seems you are quite comfortable with loading images and animating them. The tutorial above covers all the interactive effects you are seeking. I don't think anyone here can have much more to add. I encourage you to keep trying.
  8. if you want to strip the query string (the ? and all the comes after), you can run your swf's url through a cleaner function prior to putting it into your swfLoader var swfUrl:String = "someSwf.swf?cat=3"; function stripQuery(url:String):String{ var question:int = url.indexOf("?"); if(question!=-1){ var cleanUrl:String = url.slice(0, question); return cleanUrl; }else{ return url; } } //test trace(stripQuery(swfUrl)); trace(stripQuery("http://www.somedomain.com/someSwf?size=8&color=red")); //or real world usage: var swf:SWFLoader = new SWFLoader(stripQuery("someSwf.swf?cat=3"), {name:"mainSWF", container:this, x:50, y:100, onInit:initHandler, estimatedBytes:9500})
  9. do you mean that after the event occurs the tween should only take 1 second more? if so I don't think you need currentTime + 1. that means if the tween is 4 seconds into the 30 seconds the tween would then take 5 seconds to finish. I did a quick test with this and got results with no jump: import com.greensock.*; import com.greensock.easing.*; var prop:Number = 10; var tween:TweenMax = TweenMax.to(this, 30, {prop:1, ease:Linear.easeNone, onUpdate:traceIt}) function traceIt(){ trace(prop); } stage.addEventListener(MouseEvent.CLICK, resetDuration); function resetDuration(e:MouseEvent):void{ trace("\nchangeTween\n") tween.duration = 1; } this is the output that I got: 9.9397 9.9349 9.9289 9.916 9.904 9.8908 9.8788 9.8659 9.8539 9.841 9.829 9.8158 9.8038 9.7909 9.7789 9.7657 9.754 9.7408 9.7288 9.7159 9.7039 9.691 9.679 9.6658 9.6538 9.6034 9.5983 changeTween 9.3463 8.9863 8.626299999999999 8.2393 7.8793 7.4833 7.0963 6.7363 6.3763 5.9893 5.6293 5.2333 4.8463 4.4863 4.1263 3.7393 3.379299999999998 2.9833000000000016 2.5963000000000003 2.2363 1.8762999999999987 1.4892999999999983 1.129299999999997 1 is that more what you are expecting? it is possible I am mis-understanding you.
  10. the behavior you are describing pretty much sums up a complete dynamic slideshow with interactive thumbnails. This goes a good deal beyond, "not knowing how to code an onClick function". Unfortunately this is quite a big task for someone just to provide a complete solution for as there is a good deal of logic and interactivity that needs to be addressed. Fortunately, GreenSock has provided a sample of a very robust yet elegant slideshow. Many of the concepts would pertain to what you are trying to achieve: you can download this slideshow at http://www.greensock.com/as/LoaderMax/slideshow.zip
  11. most certainly. please investigate the resources mentioned here: viewtopic.php?f=6&t=5199 in general, for a progress bar, you would simply adjust the .width of a MovieClip or Sprite to be the same as the loader's progress (a value between 0 and 1); you would do this repeatedly with an onProgress eventListener. if you have a simple looping animation like a spinner, you would just hide it when the loader fires its onComplete eventListener.
  12. your problem is that you are inserting tweens into the same timeline over and over again. so your timeline just keeps getting bigger. if you re-create the timeline each time you may get the results you are after. try: function move() { //next line creates new timeline timeline = new TimelineMax(); for ( var s = 1; s { //timeline.insert( TweenMax.to(target, time, {attribute to be tweened, ease} timeline.insert( TweenMax.to(_root["project"+(projects_counter+1-s)], (1/((1/s)+1)), {_y:100-(s*35), ease:Circ.easeOut})); timeline.insert( TweenMax.to(_root["project"+(projects_counter+s)], (1/((1/s)+1)), {_y:100+((s-1)*35), ease:Circ.easeOut})); //Move the (with an index >= the clicked one) projects up } timeline.play() } //in your file project2 was calling an open() function instead of move()
  13. Carl

    fades

    i could not open your file as it is saved as Flash CS5.5 To answer your question, yes TweenLite would be phenomenal at enhancing something like this. There is a fair amount of ActionScript code and concepts that you will need to know before getting it to work properly. For a project like this 90% of what you need is basic flash and actionscript. the remaining 10% would be very basic TweenLite to "make it look nice". You will get the most value out of the forums if you post something that has shown that you made some effort with TweenLite and you need a little extra help implementing it properly. It would be a bit much for someone here to walk you through all the basic mechanics of ActionScript to get your menu buttons to communicate effectively with each other. Perhaps once you post an earlier version of your file the solution may not be so elaborate. this might help as well: http://www.tutvid.com/tutorials/flash/t ... nMenus.php
  14. unfortunately, I don't have a lot of time to trouble-shoot issues with your project on an on-going basis. I would suggest trying to get the simple mechanics to work first: 1) image falls 2) text appears 3) next image falls 4) next text appears etc. once that is solid, then worry about a custom handwriting effect that involves the masking of various assets and tweening of tons of balls. I see in your code you have a loop set to run 900 times. I would really focus on simplifying that if possible before looking anywhere else. more specifically this line here inside that loop var clip:MovieClip=currentBolitas["bola"+count]; makes me think there are 900 objects inside currentBolitas, but I couldn't seem to find them.
  15. it seems you are doing a little mix and matching which I hope to straighten out for you. 1)allTo should be used when all of your objects are stored in an array AND all those object's have properties that tween to the same value. for instance let's say you need 3 images to tween their alpha to 100 var imagesArray = [cat, dog, mouse]// each of these is the instance name of a movie clip TweenMax.allTo(imagesArray, 1, {_alpha:100}, 1); the big advantage is that you don't need a loop at all, TweenMax does that for you. 2)by putting your allTo inside a loop you are probably causing problems. The thing is you need the loop as it appears each object tweens to different y values. all the tweens need to be unique. 3)by putting your timeline inside the loop you are creating many timelines Here is the simple non-TimelineLite version: for ( var s = 1; s { TweenMax.to(_root["project" + s], 1, {_y:100-(s+20), ease:Quint.easeOut, delay:1}); } if you need TimelineLite (for pausing , rewinding, restarting) var timeline:TimelineLite = new TimelineLite({paused:true}); for ( var s = 1; s { timeline.append(TweenMax.to(_root["project" + s], 1, {_y:100-(s+20), ease:Quint.easeOut, delay:1})); } timeline.play()
  16. I don't know if this is the best way, but it worked for proportionalInside and proportionalOutside var imgLoader:ImageLoader = e.target as ImageLoader; var img:Sprite = imgLoader.content; var rawImg = imgLoader.rawContent; addChild(img); img.graphics.lineStyle(5,0x000000); img.graphics.drawRect(rawImg.x,rawImg.y,rawImg.width,rawImg.height);
  17. looks like you have made great progress. make sure there are no items on the stage covering up your images. if you are using my bullet-proof method, make sure everything that is invisible uses autoAlpha:0; OR do addChild(galerijaTXT_mc) to put it on top of everything else.
  18. i'm a little confused. but I'm not so sure the children of timeline that is being frame-tweened will advance. can you post a simplified example?
  19. yes, the example i provided shows how to randomize the order in which objects fall. each object has its own text effect which happens after it falls.
  20. this should help: viewtopic.php?f=6&t=3927&p=15446&hilit=onCOmplete+determine+loader+type#p15488
  21. okay, here is a very simplified approach. i didn't recreate your masked bars effect or anything preview http://www.snorkl.tv/dev/amor/ code: import com.greensock.*; import flash.display.MovieClip; import flash.text.TextField; var tl:TimelineMax = new TimelineMax(); //place photo and text in objects inside array. //when you shuffle array the photo and text stay together. var stackArray:Array = [ {img:img1, textbox:red_txt}, {img:img2, textbox:blue_txt}, {img:img3, textbox:green_txt}, {img:img4, textbox:yellow_txt} ] trace(stackArray[0].img.name)//output img1 trace(stackArray[0].textbox.name) // output red_txt var len:Number = stackArray.length; var shuffled:Array = [len]; for(var i:int = 0; i { shuffled[i] = stackArray.splice(int(Math.random() * (len - i)), 1)[0]; trace(shuffled[i].img.name); var currentImg:MovieClip = shuffled[i].img; var currentTxt:TextField = shuffled[i].textbox; var imgDur:Number = 1; tl.append(TweenMax.to(currentImg, imgDur, {y:200})); //multi tween text timeline var textTl:TimelineMax = new TimelineMax({delay:imgDur*(i+1)}); textTl.append(TweenMax.to(currentTxt, .5, {x:currentImg.x})); textTl.append(TweenMax.to(currentTxt, .2, {y:260})); textTl.append(TweenMax.to(currentTxt, .2, {scaleX:2, scaleY:2, repeat:1, yoyo:true})); } basically the tl timeline handles the "photos" animating. each time a photo animation is added to tl I create a separate timeline called textTl which handles animating each textbox. the delay of the textbox timeline is based on the duration of photo animation * the current iteration of the loop. i originally had everything in one timeline, but if you ever want to repeat a text animation infinitely repeat:-1.. it messes with the timing and append values. this way has a few pros and cons but should be a good starting point for you. i attached a cs4 fla
  22. without seeing your file (it wasn't attached) I think I have an idea. the problem is that your array of images is shuffled, so that means img1 is hardly ever the first photo to fall. Yet, your when your loop runs and looks for img1: for(var i:int = 0; i { shuffled[i] = stackArray.splice(int(Math.random() * (len - i)), 1)[0]; setChildIndex(DisplayObjectContainer(shuffled[i]), numChildren - 1); //trace(shuffled[i].name); ///////////////////////////////////////////////////////////////////////////////// ///////////PROBLEM HERE////////////////// if (shuffle[i] == img1) { ' that executes immediately and even if img1 is the last image in the array, the amor_tl gets built at the same time the following code executes: var tl:TimelineMax = new TimelineMax ({}); tl.appendMultiple(TweenMax.allFrom(shuffled, 3, { y: -3000, alpha:0, ease:Back.easeOut, easeParams:[.8]}, 5)); in concise terms, amor_tl is always being told animate right away, but img1 may not happen til 5 or 30 seconds later. you need to have a way that img 1 falling directly triggers amor_t starting. i have some ideas, but they will take a little time to experiment. its a fun challenge. I'll have something in an hour or so, or perhaps tomorrow if I run into trouble:)
  23. Hi Vigil, I just downloaded it and it unzipped fine on my mac. I don't doubt that you had problems. See the attached re-zipped version and let me know if it works for you. thanks Carl
  24. do you get the problem with just the dropshadow? I've found that drop shadows and glows tend to cause tons of mouse event misfires as you have explained. my solution has been to dynamically create a solid-filled yet transparent sprite over the object with the shadow. this sprite needs to be big enough to cove the full width of the object + shadow distance.
  25. Hi Cha, you're welcome. Keep the enthusiasm up. AS3/flash/greensock can be a ton of fun. Carl
×
×
  • Create New...