View Full Version : help in flash script
deepakdeep
05-02-2008, 09:47 AM
rediff.com uses swf ads at top left corner which expands when we visit the site and after few seconds it goes back to its original position.. is there any script used in that, for temporary period u can also view the same funda is used in http://tataindicomwifi.com/
pls give the solution
Medyman
05-02-2008, 01:52 PM
How familiar are you with Flash and ActionScript?
There isn't any really complicated coding going on there. The magic is really in how you embed the Flash file and CSS z-indexing.
If you embed the file using transparent window mode (http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_14201), it'll have a transparent background. Then you just position the movie as you need to using z-indexing (http://www.tjkdesign.com/articles/z-index/teach_yourself_how_elements_stack.asp) and it seems like the flash is "floating" above your content.
Here (http://www.visualbinary.net/files/tutorials/expandable-banner/) is an example I made a while ago when someone asked me the same question. Click on the movie to expand it. The mountains in the background are an image. Added using regular old HTML. I've included the flash source files (in both Flash 8 and CS3). You're welcome to take a look at the CSS and HTML, as well. Just be mindful of the noncommercial CC license.
Let me know if you have any other questions.
ReadyToLearn
05-02-2008, 05:06 PM
What luck. I was just about to post a question to this.
Medyman, that's a great example. I've downloaded the source and have a few questions.
1. Would it be possible to make the entire add draggable. So the user can take out out of the way if you wanted to.
2. How would I make it so that instead of appearing wright away, the back animates to expand.
3. What font did you use for the text? I really like it.
4. Can I use this on my website? Or is that against your license?
Thanks
Medyman
05-02-2008, 05:52 PM
Would it be possible to make the entire add draggable. So the user can take out out of the way if you wanted to.
I wouldn't recommend that use implement any flash add that is going to get in the way of content. At best it should appear and after a certain period go back to it's collapsed position.
In any case, if you want to do this...look into the startDrag() (http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00002516.html) and stopDrag() (http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00002516.html) methods.
How would I make it so that instead of appearing wright away, the back animates to expand.
For any kind of tweening (animation), I always use MC Tween (http://hosted.zeh.com.br/mctween/) or Tweener (http://code.google.com/p/tweener/). It would be fairly easily to implement MC Tween in this instance.
For example, replace
ad.back._height = Stage.height;
with
back.resizeTo(back._width, Stage.height, .5, "easeOutQuad");
If you do that, you should get rid of the positioning on the text field. Unless you use it in conjunction with MC Tween's onTweenComplete (http://hosted.zeh.com.br/mctween/doc_ontweencomplete.html) method, it won't have the height of back until the animation completes (and you're calling it before the animation completes).
What font did you use for the text? I really like it.
It's called nevis. It's available here (http://www.tenbytwenty.com/products/typefaces/nevis) for free.
Can I use this on my website? Or is that against your license?
Yeah, sure. I just mean don't sell my code as yours. Thanks for asking though.
deepakdeep
05-03-2008, 04:06 AM
Thanks a lot Medyman ... can i get the source files to understand better
Medyman
05-03-2008, 05:07 PM
Thanks a lot Medyman ... can i get the source files to understand better
Yea, they're on the page. Where it says
Source: Flash 8 & Flash CS3
Those would be links to the source!
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.