Jump to content
Search Community

mrEmpty

Members
  • Posts

    140
  • Joined

  • Last visited

Everything posted by mrEmpty

  1. Hello. When using Draggable and ThrowProps and using snap to certain points, is there a way to increase the speed that snap happens at? Currently the div settles into position slowly, I'd like the tension to be much higher. Thanks. Ignore: maxDuration works.
  2. mrEmpty

    1.9 Text Tweening

    Ahh, ignore me, I was being crazy stupid. The server hadn't updated.
  3. mrEmpty

    1.9 Text Tweening

    Hello. OK, I have an element I want to test the text tweening on. I'm getting at it as so: var experimentOneMainButton = $(':last-child p', masterContainer); If I use experimentOneMainButton.text = 'some text'; all is good. However, if I use: TweenMax.to(experimentOneMainButton, 2, {text:"Close", ease:Linear.easeNone}); Nothing happens. I'm confirming in the console that experimentOneMainButton is the element I'm needing. Any ideas? I can post the entire function if that helps? Cheers.
  4. Hello, it's nice to be back. Work gets in the way some times. It was noticeably awful, sometimes, but not others. You'd refresh and it would be slick, then you'd try again and it'd look like it was buffering. Our divs contained text elements, although to be honest, even an empty div with background colour would mess up. Canvas was slick, and I'm happy to stick with that, but I'll keep researching this because it's fun and may come in handy.
  5. I've moved to doing it all in canvas, but am interested if anyone has any ideas on this.
  6. Hello. First off, I'm loving GSAP on JS, wish it would come to iOS... OK, so I am doing a simple test, converting a Flash app to HTML. We have some absolute positioned divs, 1520px x 750px on a 1920x1200 screen. At the moment I'm simply using TweenMax to animate the css left property, and the animation on Chrome is very jerky. We have to use Chrome for other reasons. Sometimes the animation runs very smooth, other times it's running at something like 8fps. I'll include the incredibly simple JS in case anyone wants it. pOne = $("#panelOne"); TweenMax.to(pOne, 0.45, {css:{left:"-1500px"}}); Any ideas? Nothing is showing in any log, the system is a Win7 PC and it's fairly capable, nice GPU etc. Running Chrome in kiosk mode. Cheers.
  7. Hello. OK, knowing Greensock I 100% understand that this problem is with my code. I have an array of display objects. I'm pushing new items into this array using the following function. public function addSubItem(Item:DisplayObject, ID:int):void { trace('Adding item with ID: ', ID); if (!isAnyTweening(scrollerItemsArray)) { scrollerItemsArray.push(Item); scrollerIDArray.push(ID); Item.y = (scrollerSprite.y - Item.height); scrollerSprite.addChild(Item); for each (var i:DisplayObject in scrollerItemsArray) { TweenMax.to(i, 0.25, {y:i.y + (Item.height + 5)}); } } } And I'm removing the items from the array with this function: public function removeSubItem(ID:int):void { trace('Remove item at position: ', ID); var removeItemPlace:int = scrollerIDArray.indexOf(ID, 0); //get the location in the array of the item we are removing if (removeItemPlace == -1) { return; } else { var removeItemHeight:int = scrollerItemsArray[removeItemPlace].height; //get the height of that item trace('remove height is: ', removeItemHeight); //remove the actual object scrollerSprite.removeChild(scrollerItemsArray[removeItemPlace]); //tween the items below that one upwards for (var i:int = 0; i < scrollerItemsArray.length; i++) { if (i == removeItemPlace) { break; } trace(i); TweenMax.to(scrollerItemsArray[i], 0.25, {y:scrollerItemsArray[i].y - (removeItemHeight + 5)}); } //remove the item from the arrays scrollerItemsArray.splice(removeItemPlace); scrollerIDArray.splice(removeItemPlace); } } Which is all working fine. However, once I've performed an item remove, if I then add another item, the tween will work on all but one item, the one 'above' the item which was removed. It's hard to describe, so here is a video: http://youtu.be/7NkBkoAejtI Any ideas what I've done wrong here? I know this isn't Greensock specific, but this is the best forum for finding people who really know Flash. Thanks.
  8. Ignore me, had to reforce the update. scrollerBlit.update(null, true);
  9. Hello. Say you create a sprite and are using a BlitMask on that sprite: private var scrollerSprite:Sprite = new Sprite(); private var scrollerBlit:BlitMask; scrollerBlit = new BlitMask(scrollerSprite, 0, 0, scrollerWidth, scrollerHeight, true, true, 0x000000); scrollerBlit.wrap = true; All happy. Now, let's say later on you need to add children to scrollerSprite: scrollerSprite.addChild(Item); That item will not appear for me, it's being masked by the BlitMask. How can I resolve this? I'm updating the mask after adding the child, but this makes no difference. Thanks.
  10. Hello. Wasn't sure where else to ask this, and it's inked to GS so here we go. The example panel scroller on the Throwprops page, it's breaking for me if I run it at 60fps. At 30fps it's fine, anything above 30fps and the tracking of the mouse seems to break. I'm interested to understand why.
  11. Hello. Sadly the hierarchy is set, I can't change it, it's all to do with a very complex set of gesture controls which are required. Your solution is what I'm testing now, so I'm glad I'm on the right path. I'll keep at it, I have a week left.
  12. Nah, still no good. OK, if you have a parent that is moving 1280 pixels over 0.7 seconds but you want to delay the movement of it's children by 0.35 seconds, how would you do it? At the moment I'm moving the child in the opposite direction by 640 pixels then tweening it back to 0. But this results in some freaky animation, even when using the same easing types.
  13. I'm on the road to solving this by rethinking it. Once it's working I'll post the code, just in case anyone can suggest a cleaner way
  14. I guess the headache is one I need to deal with, I'm not sure what I'm asking. I am gong to look into a custom ease which can handle the backwards then forwards motion in one tween. The problem I see with that is I'm tweening from x:0 to x:0
  15. Hello. Thanks for replying. My headache is that the parent moves into view, say in 1 second. I need to delay the other items moving in by say, 0.25, 0.5 etc etc seconds. How I'm doing this now is when the master moves to the left I call a public function in the class that builds each page, this function moves the items in the opposite direction to the master for n seconds, then moves them back to x:0 in n seconds, which gives the delayed effect. It seems like a messy way to do it and it's taking hours of tweaking to get anywhere endear looking good. I'd not normally have the master parent configuration like this for this type of animation, but it was required for other stuff going on in the app. That code looks like this: slideInLeft.insert(new TweenMax(contentBox, 0.1, {x:contentBox.x + 100})); slideInLeft.insert(new TweenMax(contentBox, contentTime, {x:contentBox.x, delay:0.1, ease:Cubic.easeOut})); This is for if the main parent moves left, it delays the contentBox moving in by tweening it right, then left. It's a hack.
  16. Hello. Not sure how to describe the scenario so I'll simplify it. Imagine you have the Greensock panel flick example on the throw props page. Basically a large movie clip with panels inside it which moves left and right. I have something similar. My panels are comprised of complex pages with images and text panels etc. I've been asked late on on the project to add an offset to how the items move in, but as they are all on a large clips which moves, the only way I can think of doing it is to tween each item in the opposite direction to the master MC, then tween back into place, cause the delay effect. Here's an image. The pink bit is the main page that itself moves, it's the parent of the cream parts inside. I need to tween these so number 1 comes in, then 2 etc etc. Any ideas on a clean way to do this as currently I have a very complex timeline animation pushing the items +x then back to the origin so they pause, then snap into place. It's becoming a bit like spaghetti. I can share code if it helps. Thanks.
  17. Using ImageLoader to grab an image and place it into sprite container... pageImageLoader.append( new ImageLoader(pageImage, {name:"mainImage", container:imageBox, scaleMode:"proportionalOutside", crop:true, width:520, height:685}) ); pageImageLoader.load(); is causing me problems if I set the size of the sprite (imageBox) immediately before performing the load. I need to have a drop shadow on the images (not created in the image itself sadly) so I'm applying a drop shadow filter tot he sprite that I load the image into. I set the size of the sprite to be the size of the image loaded, load the image, but then the loaded image is stretched out vertically. So whilst the above code works, this code wont: imageBox.width = 520; imageBox.height = 685; pageImageLoader.append( new ImageLoader(pageImage, {name:"mainImage", container:imageBox, scaleMode:"proportionalOutside", crop:true, width:520, height:685}) ); pageImageLoader.load(); Any ideas? Thanks.
  18. Ahh, ok, thanks, that makes sense. Thank you.
  19. Hello. I have a sprite which I'm loading an image into: imageBox.graphics.beginFill(0xffffff); imageBox.graphics.drawRect(0, 0, 100, 100); imageBox.graphics.endFill(); & var pageImageLoader:LoaderMax = new LoaderMax({name:"mainImageLoader"}); pageImageLoader.append( new ImageLoader(pageImage, {name:"mainImage", container:imageBox, scaleMode:"proportionalInside"}) ); pageImageLoader.load(); After I have completed the load I position and size the sprite: imageBox.x = 710; imageBox.y = 30; imageBox.width = 465; imageBox.height = 665; When the sprite is created initially it's width and height are set to 100. The result is the loaded image is scaled massively. If I set the sprites width and height to the same vales as I do later (465 665) the image displays correctly. My problem is that depending upon a conditional earlier on, the size of the final sprite can be any of 7 different widths and/or heights, and I need the image to display correctly. I've tried loading the image last, setting the sprite to be 0,0 etc. Any ideas? Thanks.
  20. One thing I noticed while tracing out fred in the rainbowTween function was it traced NaN, but if I trace them in the rainbow function I get the correct numbers from the XML. EDIT: I fixed the NAN issue. My problem is on my tween I'm adding the numbers instead of tweening from one number in the XML to the next.
  21. Hello. I am loading a lot of RGB values in from an XML and storing them in an XML List: xmlContent = event.target.content.colour; Each colour tag contains three sub tags, for RGB: <colour> <red>147</red> <green>223</green> <blue>184</blue> </colour> Which I access with: xmlContent[i].blue etc etc What I need to do is tween through the values in that list, updating three public vars and using an onUpdate send those numbers out to my DMX controller. In the past I've used something like: playHead.append(new TweenMax(this, 2, {rred:xmlContent[j].red, ggreen:xmlContent[j].green, bblue:xmlContent[j].blue})); which throws no errors but doesn't work either. A more complete chunk of code to look at: private function rainbow(event:MouseEvent):void { trace('rainbow called'); var playHead:TimelineMax = new TimelineMax({onUpdate:rainbowTween}); for (var j:int = 0; j < xmlContent.length(); j++) { playHead.append(new TweenMax(this, 2, {rred:xmlContent[j].red, ggreen:xmlContent[j].green, bblue:xmlContent[j].blue})); //TweenMax.to(this, 2, {rred:xmlContent[j].red, ggreen:xmlContent[j].green, bblue:xmlContent[j].blue, onUpdate:rainbowTween}); } } private function rainbowTween():void { trace('.'); for(var i:int = 0; i < 100; i++){ if((i - 1) % 3 == 0){ // every 3rd number starting with 1 MainDMX.sendDmx(rred, i); } if((i - 2) % 3 == 0){ // every 3rd number starting with 2 MainDMX.sendDmx(ggreen, i); } if((i - 3) % 3 == 0){ // every 3rd number starting with 3 MainDMX.sendDmx(bblue, i); } } } So my question is how can I tween through my numbers, taking 2 seconds to tween between the values? I can post the entire code if that would help but it's huge
  22. Hello. I'll post the rest of the code tomorrow when I'm back at work, but it's a standard timeline. I think it's a ropey fla because it doesn't happen on other projects, using identical code. I guess the rumour of fla files going bad sometimes is true.
  23. Hello. For some reason this: tl.append(new TweenMax (this, 1, {red:127, green:50, blue:25, onUpdate:goDMX, ease:Linear.easeNone})); doesn't take a second to tween the variables, instead it's instant. The goDMX function only traces once also, instead of the many times I'd expect. The red green and blue vars are generic public number variables. Can somebody please point out the obvious mistake I can't see! Thanks.
×
×
  • Create New...