Jump to content
Search Community

ness_du_frat

Members
  • Posts

    14
  • Joined

  • Last visited

ness_du_frat's Achievements

0

Reputation

  1. Yes, I watched the video. Very useful ! I used timelinelite in one of my movieclips, but I would have needed in another one, in which I cannot do the tween with as3 (I had to do it manually, it was to complicate to do it with code).
  2. Oh, I have another question : can TimeLineLite be used with regular flash motion tweens ? or can it be used only with GS tweens ?
  3. Thanks ! Actually, I tried a version with contact_form added manually and visible set to false, the problem was the same. But thanks for trying And BTW, there is absolutely no reason why return() should be called before donneesok, since the very first page shown is that of the contact form (which is here at that moment, when the page loads), and return is called only once a button has been clicked. But anyway, sometimes, strange things happen...
  4. Oh, yes, sorry, I totaly forgot about the captcha stuff... I put the xml as well.
  5. I really can't find the problem. Actually, I must have understood something wrong, because my first attempt was to do "addChild" for the contact_form, or chatwindow, when the corresponding button was clicked, and removeChildAt, to remove it before putting something else in its place. Couldn't get it to work. Anyway, I posted the fla on megaupload, if you want to have a look, it's in the movieclip called "ecranscloseup". http://www.megaupload.com/?d=YJGKNYYE Thanks
  6. I thought the errors might be unrelated, but you're right. Anyway, I cannot understand this error, since everything is where it's supposed to be, and if you check my code, contact_form is created at the begginning, way before the function is executed. I thought maybe flash would load the classes first and have a look inside or whatever, before creating the contact_form, and would trigger an error because something is missing.
  7. Oh, if I could post the fla, I surely would, but I doubt you'd want to download a 25Mb fla file ^^ Anyway, that's the complete error : TypeError: Error #1009: Cannot access a property or method of a null object reference. at ecrancloseupC/retour()[ecrancloseupC] at Function/http://adobe.com/AS3/2006/builtin::apply() at com.greensock.core::TweenCore/complete()[/users/Ness/Desktop/flash files/com/greensock/core/TweenCore.as] at com.greensock::TimelineLite/renderTime()[/users/Ness/Desktop/flash files/com/greensock/TimelineLite.as] at com.greensock.core::SimpleTimeline/renderTime()[/users/Ness/Desktop/flash files/com/greensock/core/SimpleTimeline.as] at com.greensock::TweenLite$/updateAll()[/users/Ness/Desktop/flash files/com/greensock/TweenLite.as] Which is really funny, because I don't know why on earth I would have a null object reference at line 88... I'm putting the code right below : import com.greensock.*; import com.greensock.easing.*; var chatwindow:chatwindowC=new chatwindowC; ecran.addChild(chatwindow); chatwindow.name="chatwindow"; ecran.getChildByName("chatwindow").x=20; ecran.getChildByName("chatwindow").y=50; ecran.getChildByName("chatwindow").visible=false; ecran.contentfond.visible=false; var cible; var oldcible; var fichierXML:XML; var chargeurDonnees:URLLoader=new URLLoader(); var adresseFichierXml:URLRequest=new URLRequest("pages.xml"); function donneesOk(event:Event) { fichierXML=new XML(chargeurDonnees.data); var contact_form:contactformC=new contactformC(); contact_form.name="contact_form"; ecran.addChild(contact_form); ecran.getChildByName("contact_form").x=20; ecran.getChildByName("contact_form").y=50; ecran.title_txt.text= fichierXML.page.(@nom=="contact").@titre; ecran.contentfond.content_txt.text= fichierXML.page.(@nom=="contact").@contenu; oldcible="contact"; cible="contact"; } chargeurDonnees.load(adresseFichierXml); chargeurDonnees.addEventListener(Event.COMPLETE, donneesOk); // le contenu : contact.addEventListener(MouseEvent.MOUSE_DOWN, tween); chat.addEventListener(MouseEvent.MOUSE_DOWN, tween); quiz.addEventListener(MouseEvent.MOUSE_DOWN, tween); information.addEventListener(MouseEvent.MOUSE_DOWN, tween); facebook.addEventListener(MouseEvent.MOUSE_DOWN, tween); rss.addEventListener(MouseEvent.MOUSE_DOWN, tween); liens.addEventListener(MouseEvent.MOUSE_DOWN, tween); questions.addEventListener(MouseEvent.MOUSE_DOWN, tween); galerie.addEventListener(MouseEvent.MOUSE_DOWN, tween); persos.addEventListener(MouseEvent.MOUSE_DOWN, tween); guestbook.addEventListener(MouseEvent.MOUSE_DOWN, tween); // l'écran : var myTimeline:TimelineLite = new TimelineLite({onComplete:retour}); function tween(evt:MouseEvent) { trace("le target"+evt.currentTarget.name); cible=evt.currentTarget.name; myTimeline.append(TweenMax.to(ecran, 1, {x:1000, y:70, tint:0x3399cc,rotation:360,scaleX:0.2, scaleY:0.2, alpha: 0.1})); //myTimeline.append(TweenMax.to(ecran, 2, {x:1000, y:70, tint:null,scaleX:1, scaleY:1, alpha:0.5, ease:Back.easeOut})); myTimeline.play(); ecran.title_txt.text= fichierXML.page.(@nom==oldcible).@titre; if (ecran.content_txt) { ecran.contentfond.content_txt.text= fichierXML.page.(@nom==oldcible).@contenu; trace(ecran.contentfond.content_txt.text) } else ("pas de content") trace(oldcible); } function retour():void { oldcible=cible; TweenMax.to(ecran, 2, {x:400, y:70, tint:null,scaleX:1, scaleY:1, alpha:0.5, ease:Back.easeOut}); switch (cible) { case "contact" : ecran.getChildByName("contentfond").visible=false; ecran.getChildByName("contact_form").visible=true; ecran.getChildByName("chatwindow").visible=false; ecran.title_txt.text= fichierXML.page.(@nom==cible).@titre; break; case "chat": ecran.getChildByName("contact_form").visible=false; ecran.getChildByName("contentfond").visible=false; ecran.getChildByName("chatwindow").visible=true; ecran.title_txt.text= fichierXML.page.(@nom==cible).@titre; ecran.contentfond.content_txt.text= fichierXML.page.(@nom==cible).@contenu; break; default : ecran.getChildByName("contact_form").visible=false; // that's line 88 ecran.getChildByName("contentfond").visible=true; ecran.getChildByName("chatwindow").visible=false; ecran.title_txt.text= fichierXML.page.(@nom==cible).@titre; ecran.contentfond.content_txt.text= fichierXML.page.(@nom==cible).@contenu; } }
  8. So, no idea about the error messages ?
  9. Oh, that's cool !!! Too bad I haven't seen it earlier, that would have saved me a few lines of code. Anyway, I might change my code for the one you gave me, might make the things clearer. So, about the code generating the error : import com.greensock.*; import com.greensock.easing.*; var contact_form:contactformC=new contactformC(); contact_form.name="contact_form"; ecran.contentfond.visible=false; var cible; var oldcible; var fichierXML:XML; var chargeurDonnees:URLLoader=new URLLoader(); var adresseFichierXml:URLRequest=new URLRequest("pages.xml"); function donneesOk(event:Event) { fichierXML=new XML(chargeurDonnees.data); ecran.addChild(contact_form); ecran.getChildByName("contact_form").x=20; ecran.getChildByName("contact_form").y=50; ecran.title_txt.text= fichierXML.page.(@nom=="contact").@titre; ecran.contentfond.content_txt.text= fichierXML.page.(@nom=="contact").@contenu; oldcible="contact"; cible="contact"; } chargeurDonnees.load(adresseFichierXml); chargeurDonnees.addEventListener(Event.COMPLETE, donneesOk); // le contenu : contact.addEventListener(MouseEvent.MOUSE_DOWN, tween); chat.addEventListener(MouseEvent.MOUSE_DOWN, tween); quiz.addEventListener(MouseEvent.MOUSE_DOWN, tween); information.addEventListener(MouseEvent.MOUSE_DOWN, tween); facebook.addEventListener(MouseEvent.MOUSE_DOWN, tween); rss.addEventListener(MouseEvent.MOUSE_DOWN, tween); liens.addEventListener(MouseEvent.MOUSE_DOWN, tween); questions.addEventListener(MouseEvent.MOUSE_DOWN, tween); galerie.addEventListener(MouseEvent.MOUSE_DOWN, tween); persos.addEventListener(MouseEvent.MOUSE_DOWN, tween); guestbook.addEventListener(MouseEvent.MOUSE_DOWN, tween); // l'écran : var myTimeline:TimelineLite = new TimelineLite({onComplete:retour}); function tween(evt:MouseEvent) { trace("le target"+evt.currentTarget.name); cible=evt.currentTarget.name; myTimeline.append(TweenMax.to(ecran, 1, {x:1000, y:70, tint:0x3399cc,rotation:360,scaleX:0.2, scaleY:0.2, alpha: 0.1})); //myTimeline.append(TweenMax.to(ecran, 2, {x:1000, y:70, tint:null,scaleX:1, scaleY:1, alpha:0.5, ease:Back.easeOut})); myTimeline.play(); ecran.title_txt.text= fichierXML.page.(@nom==oldcible).@titre; if (ecran.content_txt) { ecran.contentfond.content_txt.text= fichierXML.page.(@nom==oldcible).@contenu; trace(ecran.contentfond.content_txt.text) } else ("pas de content") trace(oldcible); } function retour():void { oldcible=cible; TweenMax.to(ecran, 2, {x:400, y:70, tint:null,scaleX:1, scaleY:1, alpha:0.5, ease:Back.easeOut}); switch (cible) { case "contact" : ecran.getChildByName("contentfond").visible=false; ecran.getChildByName("contact_form").visible=true; ecran.title_txt.text= fichierXML.page.(@nom==cible).@titre; break; case "chat": ecran.getChildByName("contact_form").visible=false; ecran.getChildByName("contentfond").visible=true; ecran.title_txt.text= fichierXML.page.(@nom==cible).@titre; ecran.contentfond.content_txt.text= fichierXML.page.(@nom==cible).@contenu; break; default : ecran.getChildByName("contact_form").visible=false; ecran.getChildByName("contentfond").visible=true; ecran.title_txt.text= fichierXML.page.(@nom==cible).@titre; ecran.contentfond.content_txt.text= fichierXML.page.(@nom==cible).@contenu; } }
  10. I've managed to make it work exactly like I wanted (at least the easy part), but I get these errors : at Function/http://adobe.com/AS3/2006/builtin::apply() at com.greensock.core::TweenCore/complete()[/users/Ness/Desktop/flash files/com/greensock/core/TweenCore.as] at com.greensock::TimelineLite/renderTime()[/users/Ness/Desktop/flash files/com/greensock/TimelineLite.as] at com.greensock.core::SimpleTimeline/renderTime()[/users/Ness/Desktop/flash files/com/greensock/core/SimpleTimeline.as] at com.greensock::TweenLite$/updateAll()[/users/Ness/Desktop/flash files/com/greensock/TweenLite.as] It does work, though, but I don't understand the error messages.
  11. Ok. But from what I saw, the onComplete is applied to the timeline variable, and what I need to do is call a function in the middle of the timeline. So should I define my timeline with only one tween inside, and inside the onComplete function I'll define the other tween ? Would it be the right solution ? (oh, and if you want to have a look at what I'm trying to do, here is my website (not finished at all) : http://zarkan.org/test/jeu.html (you need to click on the desk, then on the screen on the desk. If you click on the first three buttons in the column, you'll see the sliding page in action, maybe my questions will be clearer then ^^) (you'll see that, for example, the title of the sliding page changes when you click on a button, but I want it to change only when the sliding page comes back. Don't look at the content, for the moment I've only made the title changeable. I've modified the tween so that you can see the title when the page goes to the right)
  12. So, I watched the video, and it was very useful, and a lot clearer than just seeing it written in the docs. But, of course, I already have a problem, and probably an easy one. contact.addEventListener(MouseEvent.MOUSE_DOWN, tween); chat.addEventListener(MouseEvent.MOUSE_DOWN, tween); // l'écran : var myTimeline:TimelineLite = new TimelineLite(); function tween(evt:MouseEvent) { var cible=evt.currentTarget.name; myTimeline.append(TweenMax.to(ecran, 1, {x:1000, y:70, tint:0x3399cc,rotation:360,scaleX:0.2, scaleY:0.2, alpha: 0.1})); myTimeline.append(TweenMax.to(ecran, 2, {x:400, y:70, tint:null,scaleX:1, scaleY:1, alpha:0.5, ease:Back.easeOut})); myTimeline.play(); ecran.ecran.titre_txt.text= fichierXML.page.(@nom==evt.currentTarget.name).@titre; ecran.ecran.contenu_txt.text= fichierXML.page.(@nom==evt.currentTarget.name).@contenu; } So, that's my code. (I know, that's a lot of effects, but it's brand new and I'm still playing with it ^^) Now I'm a bit stuck, mainly because I don't know timelinelite very well (or it would be more accurate to say : I barely know it). When the user clicks on the contact button, I'd like "ecran" to go to the right side of the screen, then come back, and that's working perfectly. But I'd like "ecran" to bring back the info for the page "contact". I don't really now how to do that, I'm not used at all to this particular way of thinking. I guess there should be a fonction associated to the myTimeline variable, but this function should be triggered only when ecran comes back (with the ease:Back). And to complicate everything, the function will not be the same for all buttons (for some, I just have to put some text, that's what I'm (trying to do) doing with my xml file, for others, I'll need to do an addChild and place a movieclip inside ecran (and remove all other stuff). I guess the best way to do that would be to do addChild for everything, and have a movieClip with the text code inside, so that it can be removed like any other stuff. I really doubt I should do a new function for every button, but how can I pass the variables to the tween ? With the regular movieclip timeline, I would do a switch, but here, I'm lost... (I know, I'm not being very clear, but it's not THAT clear in my head either...) I would be glad for a little headstart on this one ^^
  13. I dowloaded it from here ^^ At least I think so, because I tried to have a look at the examples (the guy with the green sock that you can target to a point and have tweens applied to it), and that's when I decided to download it. I would have had a look through my browser history, in order to tell you for sure if I found it here or not, but I have a funny (eurrh, not so funny, actually) bug with Firefox, that no update could solve : I don't have any history display. Only the bookmarks.) But as I can be clever sometimes, I found it : http://www.greensock.com/as/legacy/gree ... 10-as3.zip I realise now that I downloaded an old version, but you know what ? On my first visit, I looked everywhere to find a download link, and that's the only one I found. Back here today, I started looking everywhere again, to finally realise, after 5 minutes, that it was the huge green download button on the right side of the page... Sometimes, the bigger and the more visible the things are, the less we see them ^^ (and sorry for my English, I'm French) I'll ditch my as3 with the variables and messy code, and I'll try it with TweenMax, probably tonight. Thanks !
  14. Hi ! I discovered TweenMax a few days ago, and I must it's kinda great But it's not until today I noticed I could have several tweens in sequence. I did a sliding page, and like a totally dumb girl, I twisted the code so that I could get a tween after the previous one is finished... lol. I found TimeLine, and it's exactly what I need. I plan on watching the video and reading the documentation, but first I'd like to know if what I want is doable... I guess it is, but then I also guessed it would be easy to make AS3 and mySQL communicate, and I spent my whole week-end struggling with encoding problems... Anyway. On one of my pages, I have a sliding movieclip, which displays the content, according to what button the user clicked on. (when I say button, I mean movieclips used as buttons) When the user first comes to the page, the sliding page is already there, with the default content. When he clicks on one button (let's say chat), the sliding page should slide to the right with the default content, and come back with the chat content. Right now, I have a really messy code with variables and errors everywhere, so I guess TimeLine will help me with this, since I won't have to put the code in the sliding page movieclip. So, is it doable ? Is there anything I must know before starting, so that I don't get stuck and spend ages on a stupid little mistake ? Thanks a lot !!! So, now to the stupid girl part question... I downloaded the package, but I don't have any com folder... where is it ? I only have the gs folder, and the too swf examples. I already tried doing a little something using TimeLineLite, but no surprise here, TimelineLite() is not recognized, since I don't have the corresponding package... I thought everything was in the same zip file ? I really feel stupid, here ^^
×
×
  • Create New...