Jump to content
Search Community

rob_v_5712

Members
  • Posts

    70
  • Joined

  • Last visited

Everything posted by rob_v_5712

  1. Well I have been diving head first into TimelineLite and so far love it. Since I moved to v12 - things just seem to be alot easier for me to control. I have a question that I hope someone can help me out with. Out side the scope of this post - I need to move my animations to use timelineLite (or Max). Here is the situation. I currently have an animation that has 10 arrows fly in and points to 10 boxes. Those 10 boxes then start display random numbers for a few seconds then stops. To do this, I just created a simple MC that is just a dynamic text box with flipping numbers. They are named numBox_X - where X is just a number 0 - 9. So numBox_0, numBox_2, etc... Its 60 frames, every 5 frames I have it generate a random number and display it in the text box, then at the end it stops, so all 10 MCs at the end display 10 different numbers. Right now I just tween in the arrows (using TweenLite), then on the timeline I would just add actionScript numBox_X.gotoAndPlay('flip'); (where X is the number box I want to start flipping). I have a few other things along the same line where I have multiple MCs on the stage that have animations in them. I can use timelineLite to get the arrows in as well as the boxes, Im just having trouble understanding how to fire off the number flipper MC. And once I do get it to fire off, how can I reverse it? I have no problem at all if I need to re-write things - Just looking for the best way to handle this type of situation or is that outside the scope of what TimelineMax/Lite and handle? As Im writing this - Im thinking something along the lines of tweening in the box - then call a function. Im going to start working on it, but figure Id throw a post out here as well for some suggestions. Thanks again for a killer product!
  2. Thanks Carl, Exactly the info I was looking for!
  3. Hello all, I just started using TimelineLite for some animations. From what Im seeing right now, (and I could be wrong) it appears that each time you add an item to the timeline, the offset value is based on the complete time of the last tween object added to the timeline object. So if I do this: var myTimeline:TimelineLite = new TimelineLite(); myTimeline.append(TweenLite.to(mc,1, {_x:100})3); myTimeline.append(TweenLite.to(mc,2, {_x:200})3);myTimeline.append(TweenLite.to(mc,1, {_x:300})3); The first tween hits at the 3 second mark, lasts 1 second, then the next tween fires 3 seconds after it completes, lasts for 2 second then the final tween will then fire 3 seconds after that. So the fire times are 3 seconds, 7 seconds, then 12 seconds Tween1 delay of 3 seconds, lasting 1 second : start@3 end@4 Tween2 delay of 3 seconds, lasting 2 seconds: start@7 end@9 Tween3 delay of 3 seconds, lasting 1 second : start@12 end@13 This may sound like an odd question - but is there anyway to make timeline use absolute values in either time or frames. What I mean is that regardless of how long a tween lasts, If I know that tween 1 fires at 3 seconds, tween 2, fires at 6 seconds and tween 3 fires at 9 seconds is there an easy way to handle that?
  4. Tried that but still does not work. If I dont specify a height and width in the XML it will still show items that are off the stage. if I give it a height and width and set crop=true in the XML - it works fine. My goal is to just deal w/ the container and have the swf take on the height/width of that container.
  5. Well - one more question - is there anyway I can get the swf to automatically scale to the container with out having to specify a height/width for the swf?
  6. yup operator error...turns out when I was adding the content of the swf it was doing an addChild - adding it to the stage, vs mainSwfContainer.addChild which adds it to the container. Doh!
  7. Hello all, I have a question about SWFLoader and its container that the swf gets loaded into. My goal is to have a container that I can move anywhere on the stage I want to, and use SWFloader to put the swfs in there with out having to specific an x and y in the SWFLoader XML. If I have my stage that is say 1000x1000 that has a movie clip on it that is the same size. its named mc_bg_container (just to add gfx to the background) I create my container that I want to hold the swfs at 500x500 positioned in the middle of the stage then put it on top of mc_bg_container: mainSwfContainer.graphics.beginFill(0xFFFFFF); mainSwfContainer.graphics.drawRect(0, 0, 500, 500); mainSwfContainer.graphics.endFill(); mainSwfContainer.x = 125; mainSwfContainer.y = 125; var idx = getChildIndex(mc_bg_container); addChildAt(mainSwfContainer, idx + 1); I then assign that container to the loader : var myXmlLoader:XMLLoader = new XMLLoader("xml/slide_list.xml", {name: "data_xml", maxConnections: 1, container: mainSwfContainer, onComplete: slideListCompleteHandler); The XML : What I would assume would happen is that the swf get added to that container - no matter where it lives on the stage. But what seems to happen is that the swf gets put into the top left of the stage, ignoring the container completely. Im pretty sure its operator error here - but any help would really be appreciated. Thanks -Rob
  8. Ahhh - ok - yup - makes perfect sense why its happening. The easy fix I guess would just be to set the flag (and do any other code needed) before the dispose happens. Excellent....thanks for your help - and for the awesome libraries! -Rob
  9. Deleted the above 2 posts (included code snippets) figured it was better to just include a fla file that shows what Im talking about. Pretty sure Im on the latest version of Greensock (just d/l them last week). Here is a fla w/ supporting files that demos exactly what Im talking about. If you run it as is - you will see what Im talking about in the trace - the main complete handler fires before all the children are complete. If you change the slide_list.xml and put swf 4 in any other position - it works as you would expect - all the child completes fire then the main complete. Please let me know if you see something different - or something that I am doing wrong. Thanks -Rob
  10. Hello all, I hope someone can help me out. I'm having a bit of an odd issue here. I am loading SWFs into a container using an XML file of SWFLoader nodes. After each node loads, Im checking to see if the swf meets certain criteria and set a flag. Once everything is complete - I then proceed. So I set up my loader and load it: var slideListXmlLoader:XMLLoader = new XMLLoader("xml/slide_list.xml", { name: "data_xml", onComplete: slideListCompleteHandler, onChildComplete: slideListChildCompleteHandler}); slideListXmlLoader.load(); I have these set up for my handlers : private function slideListChildCompleteHandler(e:LoaderEvent):void { trace('in slideListChildCompleteHandler'); . . . do stuff here . . . trace('leaving slideListChildCompleteHandler'); } private function slideListCompleteHandler (e:LoaderEvent):void { trace('in slideListCompleteHandler'); . . . do stuff here . . . trace('leaving slideListCompleteHandler'); } The XML has 4 nodes in it. Given that - I would expect the trace to look like this : in slideListChildCompleteHandler leaving slideListChildCompleteHandler in slideListChildCompleteHandler leaving slideListChildCompleteHandler in slideListChildCompleteHandler leaving slideListChildCompleteHandler in slideListChildCompleteHandler leaving slideListChildCompleteHandler in slideListCompleteHandler leaving slideListCompleteHandler But when I run it - it looks like this : in slideListChildCompleteHandler leaving slideListChildCompleteHandler in slideListChildCompleteHandler leaving slideListChildCompleteHandler in slideListChildCompleteHandler leaving slideListChildCompleteHandler in slideListChildCompleteHandler in slideListCompleteHandler leaving slideListCompleteHandler leaving slideListChildCompleteHandler You can see for the last node - It hits the Child Complete Handler, then the main Complete handler, then leaves the main Complete handler, then leaves the Child Complete Handler. I have a feeling its b/c of the processing that is in the slideListChildCompleteHandler that this occurs. Is there anyway to prevent this?
  11. Im kind of running into the same issue - I need to see if the current swf that is playing is done. I solved it by putting a listener on the current playing swf and check for the last frame. What I mean is say _currentSwf has the rawContent : _currentSwf = _swfLoader.rawContent; Then put a listener on that current swf to check where it is : _currentSWF.addEventListener(Event.ENTER_FRAME , checkIfComplete); private function checkIfComplete(e:Event):void { //if it the current frame of the swf equals the last frame if (_currentSwf.currentFrame == _currentSwf.totalFrames) { trace("Im at the end"); // lets remove the listener since we dont need it any more. _currentSwf.removeEventListener(Event.ENTER_FRAME, checkLastFrame); } } Anyone see any issues w/ doing it that way?
  12. Exactly what I was looking for - thanks. Just had to change it to rawContent is Loader and rawContent.content is AVM1Movie and works like a charm! Thanks again -Rob
  13. What about a way to detect them, so if it does load one, things don't break. Doing some searching I have found I can check actionScriptVersion property - but just can't seem to get it to work correctly.
  14. Any suggestions on a work around? I'd like to be able to have the player not care if its as2 or as.
  15. Im having something very odd happening. Im loading a series of 4 swfs using LoaderMAX and SWFLoader. I know that a MovieClip object should be returned when I do this call : LoaderMax.getLoader(loaderName).rawContent; This happens for 3 of the 4 swfs Im working with. The one swf happens to retun a Loader object. I did some further testing - in the childComp[leteHandler function I added the following Trace : trace("childCompleteHandler : " + e.target.name); trace('e.target.rawContent :' + e.target.rawContent); trace('e.target.content :' + e.target.content); Here were the results : ----- childCompleteHandler : swf_ID_01 e.target.rawContent :[object MainTimeline] e.target.content :[object ContentDisplay] ----- childCompleteHandler : swf_ID_02 e.target.rawContent :[object MainTimeline] e.target.content :[object ContentDisplay] ----- childCompleteHandler : swf_ID_03 e.target.rawContent :[object MainTimeline] e.target.content :[object ContentDisplay] ----- childCompleteHandler : swf_ID_04 e.target.rawContent :[object Loader] e.target.content :[object ContentDisplay] ----- I swapped out that 4th swf with another one and it came back fine. Which tells me that its something in that specific swf that is jacking something up - and not the LoaderMax code. My question is, can someone point me in the direction of what may be causing it to show as that? (Attached is the fla and the zip)
  16. Carl, Thanks for getting back to me, I really appreciate your help. I was confused as well about why the autoPlay set to false still allowed it to play. I have been playing with it a bit more, and that no longer happens. Im sure it was some type of operator error I think I have my head wrapped around it now - maybe you can just confirm for me that the way it works is actually the way I think it works w/ regards to SWFLoader. Here was my original plan and assumptions using this XML Step 1. use LoaderMAX to load an XML file of SWFLoaders. Have each node set to load="true" autoPlay="false" What I expected at this point was for 3 nodes to load and not play. The childCompleteHandler to fire after each SWFLoader node is loaded and the completeHandler to fire when the full XML file is done. (This works as expected) Step 2. I assume at the point the actual SWFs have been fully loaded (My question is where are they loaded to? memory? browser cache?) and I should then be able to reference them by their name (swf_ID_01,swf_ID_02,swf_ID_03) using LoaderMax.getLoader("what ever the loader_name is"). After bit more messing around, I am now able to do that. (The where are they loaded to question still stands - b/c I have the potential to be dealing w/ some large swfs, my goal is to get them to load up first - then when I actually play them, there will be no lag time for loading) Step 3. Because its a swf file, in order to play and stop it - I need to get the raw content of which ever swf Im dealing with - I can do that by doing this : _currentSwf:MovieClip = LoaderMax.getLoader('swf_ID_01').rawContent; then do an addChild(_currentSwf) to get it to appear in the container, then a _currentSwf.play() to play it. Kill the swf, do a removeChild(_currentSwf). Then load another (or do whatever). I almost have this working, still making a few tweaks. (Is this the only way to control the swfs to start/stop once they are loaded?) Ok - last question - I have noticed that when I access the content using _currentSwf:ContentDisplay = LoaderMax.getLoader('swf_ID_01').content; it uses the x,y parameters that are in the XML and it positions the swf on the screen where I want it to. However, if I us the rawContent instead, it seems to ignore them. Any idea why this is? Doing some testing, it looks like I have to specifically assign the x & y to the _currentSwf which holds the rawContent, this then puts it where I need it. Is there anyway to access those X & Y parameters using the loader so I can assign them? Or maybe I'm just missing something simple. Actually 1 other question while Im thinking about it. Is there a difference between instantiating a LoaderMax class and appending loaders to it like this : private var queue:LoaderMax = new LoaderMax({onProgress:progressHandler,onC....... queue.append( new SWFLoader(name1...... queue.append( new SWFLoader(name2...... queue.append( new SWFLoader(name3...... And just instantiating the XMLLoader class and reading in an XML file of SWFLoaders? I assume its the same thing, but by using the XML file the loader is smart enough to know what nodes are other loader types (in this case SWFLoaders) and basically do the append for you behind the scenes. Is this the case? Thanks again for your help, I really appreciate it!
  17. Carl, Thanks for the response, that actually makes perfect sense. I have another question for you if you don't mind. I have been playing w/ this for a bit now and I have a good handle on what events fire a what points during the execution. But I am just having a hard time wrapping my head around something. I'm making a basic SWF player. Load the swfs from an XML file, then just a simple < and > button to walk thru the swfs. So I changed around a few things from my original post. I changed the XML to this: <?xml version="1.0" encoding="iso-8859-1"?> An the PlayerMain function to this : public function PlayerMain() { LoaderMax.activate([xmlLoader, SWFLoader]); var xmlLoader:XMLLoader = new XMLLoader("xml/list.xml",{name:"data_xml", maxConnections:1, prependURLs:"assets/", container:mc_container, onComplete:completeHandler, onProgress:progressHandler, onChildProgress:childProgressHandler, onChildComplete:childCompleteHandler }); xmlLoader.load(); } Now when the xmlLoader.load() executes, the childCompleteHandler will be hit for each SWFLoader node in the XML. Which is exactly what is happening. After they all load, the completeHandler fires off, again straightforward. The container that the swfs will display in is named "mc_container". What I'm having an issue with is where should the addChild call live and how the swf actually displays in the container. Initially I put the addChild call in the childCompleteHandler. private function childCompleteHandler(e:LoaderEvent):void { addChild(e.target.content); } What that ended up doing was playing all the swfs at one time in the container. I realized it was b/c of the load=true setting in the XML. I changed 2,3,4 to load=false, and now the first swf loads and displays. Great! I have tied an eventListener to a button, so all I want to do is kill the current swf that is there and load the next one. I can kill it by using the dispose(true) thats fine, but its at this point where I am stuck. How do I load the next swf? I have been looking at this post : viewtopic.php?f=6&t=5602&p=21758&hilit=precious#p21758 The comment in the dumpTempSWF function is exactly what I want to do : //we only wanted to get the file into the browser's cache, so dump it from memory. We can load it later with another SWFLoader when we actually want to use it. So making a few more changes I now dispose it in the childCompleteHandler function, but for the life of me, I cant figure out how to load it back up. Any help at all would be very much appreciated. Im sure its just one stupid thing Im missing. Thanks and sry for the long post! -R
  18. Hello all, I have started to get into using LoaderMax and the SWFLoader for an upcoming project I'm working on. Right now I'm doing some simple proof of concept tests and am running into an issue. I have an XML file named swfList.xml that has a LoaderMax instance in it along w/ 2 SWFLoaders. Here is the XML file: I load the XMLfile then load the swfListLoader but the oncomplete and onProgress events never seem to get called. Here is a snippet of what Im doing to load it : public function PlayerMain() { LoaderMax.activate([xmlLoader,SWFLoader]); var xmlLoader:XMLLoader = new XMLLoader("xml/swfList.xml",{name:"swfList",onComplete:xmlHandler}); xmlLoader.load(); } private function xmlHandler(event:LoaderEvent):void { //get the LoaderMax named "swfListLoader" which was inside our XML var queue:LoaderMax = LoaderMax.getLoader("swfListLoader"); //store the nested SWFLoaders in an array _swfs = queue.getChildren(); //start loading the queue of SWFLoaders (they will load in sequence) queue.load(); } private function SWFcompleteHandler(event:LoaderEvent):void { trace('In the _completeHandler'); } private function SWFprogressHandler(event:LoaderEvent):void { trace('in the progress handler' + event.target.progress); } However if I add the event listener manually by adding this line after the LoaderMax.getLoader("swfListLoader") line: queue.addEventListener(LoaderEvent.COMPLETE,SWFcompleteHandler); The SWFcompleteHandler then gets executed. Can someone tell me what I am doing wrong, why is it not being executed when its in the XML file?
×
×
  • Create New...