[CS3] Flash buttons with fade effects.
Well as the title says, i've got some buttons in Flash CS3,
using AS 2 which when clicked changes the frame. The thing is that
i want to add a fade effect to the text area AFTER the button was
pressed. So for example:
The user is reading the text, he presses one of the buttons
(all of which change frames, in this case text) and the text fades
away and the new text fades in.
Well, i've designed the frames needed for this, so i've got
10 frames before the frame the user will see for it to fade in and
10 frames after it to fade out. What i havent figured out yet is
how i'll make the script do that. I mean, i can make the script go
forward one frame, starting the fade out effect, i can make it go
to the frame i want but how will i do both.
I've got 6 buttons and 6 corresponding texts.
Does anyone have any ideas?
Thank you in advance.
P.S.: Any ideas welcome. I can change the frame layout.
P.S.S.: Also forgot to mention that making layers for every
combination is out of question....
I've already had them placed each on their layer. I thought i
might need mobility on the timeline.
Let me see how much of this i understand...
quote:
which im assuming are MovieClip instances
They're graphics but i can simply change them to be movie
clips if it's the case.
quote:
do the same with your buttons on a seperate layer but you
will only need one for them all
I've lost you here....you're saying ill only need one AS
reference?
quote:
for(var i=0; i<btns.length; i++) {
Hmm... you're using the size of the array to set how many
times the loop control will actually loop? Took me a bit to figure
out what length an array could have
quote:
new Tween(current, '_alpha', Strong.easeOut, 100, 0, 10,
false);
new Tween(clips[this.id], '_alpha', Strong.easeOut, 0, 100,
10, false);
current = clips[this.id];
//start the first clip transition 'in'
current = clips[0];
new Tween(clips[0], '_alpha', Strong.easeOut, 0, 100, 10,
false);
Ok i didnt get most of this but i'll have to check out the
parameters for the Tween function.
Actually i plan on going from a 50% alpha to a 100%, but
that's just my choice.
Thanks a lot and hope i dont become too annoying.
P.S. I had a huge revelation at the end when i re-read the
code and finally understood how this is going to work.
Similar Messages
-
Arrow buttons with fade effect
I have made arrow buttons on each side of a document I intend to export to pdf. They are set to behave so that when the reader of the pdf clicks on one of them it takes them to the previous or to the next page. the issue I have is that they are distracting. Is it possible to auto-fade these buttons and when you mouse over them they fade into view?
I've made the buttons and they work fine. I found this link also helpful...http://www.dynamicgraphics.com/dgm/Article/28696
The last issue is dotted outlines that appear when I push the button in the pdf. It looks like the dotted lines came from indesign with the objects. I've attached a photo. Not so important but if there was an easy way to get rid of them that would be great. Thanks again for the help. -
Every time a page has a html5 video or a slideshow with fade effect Firefox 3.6 becomes terriblely slow. It freezes with this test: http://demos.hacks.mozilla.org/openweb/HWACCEL/
I have Fedora 14 and before that Fedora 13 and the problem happens with both.
The same doesn't happen on Opera or Google Chrome.
'''UPDATE 1''': I have already tryed the Safe Mode and the problem happens the same.
'''UPDATE 2:''' This page full of videos scroll smothly without any problemas: http://brettgaylor.tumblr.com/tagged/webmademoviesI forgot to say that I did tryed the Safe Mode just to see if the slow was not being caused by some extension or plugin. However the result was all the same. By the way, the slow happens even if there is only one page opened. I am not thinking it is something related to the ATI video card or even Fedora because the same slow does't happen in Chrome and Opera...
-
Image rotation with fade effect
I am new to the spry framework and have just started going
through the examples to see if I could create an image rotator that
fades the images into each other when changing. I have taken
snippets from different places to do this and think I have the
answer but really wanted some feedback to sanity check and let me
know if this is the best way of doing it. If it is, then I hope
others will find it useful.
Here is the url to the example:
Image
rotation example
And here is the code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml"
xmlns:spry="
http://ns.adobe.com/spry">
<head>
<title>Sample Image Rotation</title>
<meta http-equiv="content-type" content="text/html;
charset=iso-8859-1" />
<meta http-equiv="X-UA-Compatible"
content="IE=7;FF=3;OtherUA=4" />
<meta name="author" content="www.baytree-cs.com - Peter
Barkway"/>
<meta name="copyright" content="(C)2006 Baytree Computer
Services, All right reserved."/>
<meta name="abstract" content="ISM Homepage" />
<meta name="description" content="ISM Homepage" />
<meta name="keywords" content="ISM Homepage"/>
<meta name="robots" content="all,index,follow"/>
<meta name="distribution" content="global"/>
<meta name="mssmarttagspreventparsing"
content="true"/>
<meta name="rating" content="general"/>
<style type="text/css">
.element{
float:left;
position: relative;
width: 350px;
text-align: center;
#display{
opacity: 0;
filter: alpha(opacity=0);
#animate{
left: -350px;
opacity: 1;
filter: alpha(opacity=100);
</style>
</head>
<body>
<noscript><h1>This page requires JavaScript.
Please enable JavaScript in your browser and reload this
page.</h1></noscript>
<div id="container">
<div id="display" class="element"
spry:detailregion="dsImg"><img src="<?php echo
$rootDir.$baseDir;?>/{@base}{@path}"/></div>
<div id="animate" class="element"
spry:detailregion="dsImg2"><img src="<?php echo
$rootDir.$baseDir;?>/{@base}{@path}"/></div>
<p class="clear"></p>
</div>
<script type="text/javascript"
src="js/xpath.js"></script>
<script type="text/javascript"
src="js/SpryData.js"></script>
<script type="text/javascript"
src="js/SpryEffects.js"></script>
<script type="text/javascript">
var dsGalleries = new Spry.Data.XMLDataSet("spry.php",
"galleries/gallery", { method: "POST", postData:
"c=1&d=<?php echo $baseDir;?>", headers: {
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
var dsImg = new Spry.Data.XMLDataSet("spry.php",
"gallery/photos/photo", { method: "POST", postData:
"c=2&d=<?php echo
$baseDir;?>/{dsGalleries::@base}&s={dsGalleries::sitename}",
headers: { "Content-Type": "application/x-www-form-urlencoded;
charset=UTF-8" } });
var dsImg2 = new Spry.Data.XMLDataSet("spry.php",
"gallery/photos/photo", { method: "POST", postData:
"c=2&d=<?php echo
$baseDir;?>/{dsGalleries::@base}&s={dsGalleries::sitename}",
headers: { "Content-Type": "application/x-www-form-urlencoded;
charset=UTF-8" } });
var imageInterval = 8000; // 8 seconds
var imageFadeInterval = 4000; // 4 seconds
var image2Loaded = null;
var effect = new Spry.Effect.Fade('animate', {from: 100, to:
0, toggle: true, duration: imageFadeInterval});
// Prepare an observer that will change the opacity of the
initially
// hidden element in oposition with the initially visible
element
var obs1 = new Object;
// On each effect step we calculate the complementary
opacity for the other image container.
obs1.onStep = function(ef){
if (typeof otherEl == 'undefined')
otherEl = document.getElementById('display');
var opacity = 0;
if(/MSIE/.test(navigator.userAgent)){
opacity = Spry.Effect.getStyleProp(ef.element,
'filter').replace(/alpha\(opacity([0-9]{1,3})\)/, '$1');
otherEl.style.filter = "alpha(opacity=" + parseInt(100 * (1
- opacity), 10) + ")";
}else{
opacity = Spry.Effect.getStyleProp(ef.element, 'opacity');
otherEl.style.opacity = (1 - opacity);
// Attach the observer to the Fade effect
effect.addObserver(obs1);
function fadeInContent() {
// 1st time in so set the current rows so that the 'animate'
set is 1 ahead of the 'display' set
if(image2Loaded == null) {
dsImg.setCurrentRowNumber((dsImg.getCurrentRowNumber() + 1)
% dsImg.getData().length);
dsImg2.setCurrentRowNumber((dsImg.getCurrentRowNumber() + 2)
% dsImg.getData().length);
image2Loaded = 0;
} else {
if(image2Loaded) {
dsImg.setCurrentRowNumber((dsImg.getCurrentRowNumber() + 1)
% dsImg.getData().length);
image2Loaded = 0;
} else {
dsImg2.setCurrentRowNumber((dsImg.getCurrentRowNumber() + 1)
% dsImg.getData().length);
image2Loaded = 1;
effect.start();
var obs2 = {
onPostLoad: function() {
setInterval("fadeInContent()", imageInterval);
dsImg.addObserver(obs2);
</script>
</body>
</html>I think that I might have got this going now. Here is the
code if anyone wants to use it.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml"
xmlns:spry="
http://ns.adobe.com/spry">
<head>
<title>Sample Image Rotation</title>
<meta http-equiv="content-type" content="text/html;
charset=iso-8859-1" />
<meta http-equiv="X-UA-Compatible"
content="IE=7;FF=3;OtherUA=4" />
<meta name="author" content="www.baytree-cs.com - Peter
Barkway"/>
<meta name="copyright" content="(C)2006 Baytree Computer
Services, All right reserved."/>
<meta name="abstract" content="ISM Homepage" />
<meta name="description" content="ISM Homepage" />
<meta name="keywords" content="ISM Homepage"/>
<meta name="robots" content="all,index,follow"/>
<meta name="distribution" content="global"/>
<meta name="mssmarttagspreventparsing"
content="true"/>
<meta name="rating" content="general"/>
<style type="text/css">
.element{
float:left;
position: relative;
width: 350px;
text-align: center;
#display{
opacity: 0;
filter: alpha(opacity=0);
#animate{
left: -350px;
opacity: 1;
filter: alpha(opacity=100);
</style>
</head>
<body>
<noscript><h1>This page requires JavaScript.
Please enable JavaScript in your browser and reload this
page.</h1></noscript>
<div id="container">
<div id="display" class="element"
spry:detailregion="dsImg"><img src="<?php echo
$rootDir.$baseDir;?>/{@path}"/></div>
<div id="animate" class="element"
spry:detailregion="dsImg2"><img src="<?php echo
$rootDir.$baseDir;?>/{@path}"/></div>
<p class="clear"></p>
</div>
<script type="text/javascript"
src="js/xpath.js"></script>
<script type="text/javascript"
src="js/SpryData.js"></script>
<script type="text/javascript"
src="js/SpryEffects.js"></script>
<script type="text/javascript">
var dsGalleries = new Spry.Data.XMLDataSet("spry.php",
"galleries/gallery", { method: "POST", postData:
"c=1&d=<?php echo $baseDir;?>", headers: {
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
var dsImg = new Spry.Data.XMLDataSet("spry.php",
"gallery/photos/photo", { method: "POST", postData:
"c=2&d=<?php echo
$baseDir;?>/{dsGalleries::@base}&s={dsGalleries::sitename}",
headers: { "Content-Type": "application/x-www-form-urlencoded;
charset=UTF-8" } });
var dsImg2 = new Spry.Data.XMLDataSet("spry.php",
"gallery/photos/photo", { method: "POST", postData:
"c=2&d=<?php echo
$baseDir;?>/{dsGalleries::@base}&s={dsGalleries::sitename}",
headers: { "Content-Type": "application/x-www-form-urlencoded;
charset=UTF-8" } });
var imageInterval = 4000; // 8 seconds
var imageFadeInterval = 2000; // 4 seconds
var effect = new Spry.Effect.Fade('animate', {from: 100, to:
0, toggle: true, duration: imageFadeInterval});
// Prepare an observer that will change the opacity of the
initially
// hidden element in oposition with the initially visible
element
var obs1 = new Object;
// On each effect step we calculate the complementary
opacity for the other image container.
obs1.onStep = function(ef){
if (typeof otherEl == 'undefined')
otherEl = document.getElementById('display');
var opacity = 0;
if(/MSIE/.test(navigator.userAgent)){
opacity = Spry.Effect.getStyleProp(ef.element,
'filter').replace(/alpha\(opacity([0-9]{1,3})\)/, '$1');
otherEl.style.filter = "alpha(opacity=" + parseInt(100 * (1
- opacity), 10) + ")";
}else{
opacity = Spry.Effect.getStyleProp(ef.element, 'opacity');
otherEl.style.opacity = (1 - opacity);
// Attach the observer to the Fade effect
effect.addObserver(obs1);
function fadeInContent() {
// 1st time in so set the current rows so that the 'animate'
set is 1 ahead of the 'display' set
//use this flag to avoid the effect running on load
if (typeof image2Loaded == 'undefined') {
dsImg.setCurrentRowNumber((dsImg.getCurrentRowNumber() + 1)
% dsImg.getData().length);
dsImg2.setCurrentRowNumber((dsImg.getCurrentRowNumber() + 2)
% dsImg.getData().length);
var curRow = dsImg.getCurrentRow();
image2Loaded = 0;
} else {
if(image2Loaded) {
var img = document.getElementById('display');
dsImg.setCurrentRowNumber((dsImg.getCurrentRowNumber() + 1)
% dsImg.getData().length);
var curRow = dsImg.getCurrentRow();
image2Loaded = 0;
} else {
var img = document.getElementById('animate');
dsImg2.setCurrentRowNumber((dsImg.getCurrentRowNumber() + 1)
% dsImg.getData().length);
var curRow = dsImg2.getCurrentRow();
image2Loaded = 1;
var imgPath = '<?php echo $rootDir.$baseDir;?>/' +
curRow["@path"];
var gImageLoader = new Image();
gImageLoader.onload = function()
effect.start();
gImageLoader.src = imgPath;
var obs2 = {
onPostLoad: function() {
setInterval("fadeInContent()", imageInterval);
dsImg2.addObserver(obs2);
</script>
</body>
</html> -
Opening a popup window with fade effect
Hi,
I have a scenario where I want to open a pop up title window with some nice effect.
Can you please suggest how do I achieve it?
I have a repeater that repeats set of Text UI comps and I want to show a pop up window on MouseOver or MouseClick of each of these Text UI comps.
Please help.
Thank you,
Ameyif you want to open an title Window with a smooth fade effect there are more than one possible ways.
1. Declare Fade Effect
<s:Fade id="windowFade" target="{_titleWindow}" alphaFrom="0.0" alphaTo="1.0" />
2. Execute the fade effect on openening
2.1 start the effect after the PopUpManager.addPopUp
PopUpManager.addPopUp(_titleWindow, this);
windowFade.play();
2.2 start the effect on added-Event
protected function titlewindow1_addedHandler(event:Event):void
windowFade.play();
3. Make sure the effect is stopped before you start the animation with windowFade.stop() -
Open my site, dg-ad.com, and the tabbed panel drop down menu has the first level visible. Click on a menu item and the second level becomes visible. The second level has a Spry fade effect so it fades into view nicely. The class .TabbedPanelContent sets the visibilty of the second layer hidden, and there is no distracting flicker, good so far.
Besides clicking on menu item I often send clients a link with a string query which lands them on my site with the tabbed panel open to what I want them to see initially., I use a string query in the URL per Dave Powers technique often refered to in this forum titled'Spry: Opening Specific Tabs and Panels from Another Page".
Because the visibility is set to hidden in the CSS the second level of the tabbed panel is still invisible, So I am looking for suggestions that may involve scripting the style or playing with the CSS to overide the CSS and make the second level visible when users arrive via the query string method.
Thanks for taking a look!
DanielFor Spry 1.0 widgets, each widget had one core file. Each of them had common things like addClassName(), removeClassname(), along with a bunch of basic functionality. So that adds up to a lot of redundant code.
This way, all that common stuff is kept in a single file. That means that each widget base class just has what it needs to glue everything together.
Many widgets are 'panel' based: accordions, tabbed panels, slideshows. So handling those panels is done via the PanelSet and PanelSelector files.
You will find SpryTabbedPanels2.js much smaller than the first version.
By components, for instance: SpryFadingPanels.js is only needed if you want to fade between panels. If you don't want that effect, you don't need to use it. WIth components and plugins, you or anyone else can write a different transition and make that available to all your Spry UI widgets.
I don't like all the includes either but it's the right way to go with what we are doing.
Thanks,
Don -
Rotating Image with Fade Effect
Ok looking to rotate an image with a fade effect; below is a rotating image code.
(Wanting this effect to be transitional and smooth. Transparency? Opacity?)
<script language="JavaScript">
<!--
function adArray() {
for (i=0; i*2<adArray.arguments.length; i++) {
this[i] = new Object();
this[i].src = adArray.arguments[i*2];
this[i].href = adArray.arguments[i*2+1];
this.length = i;
function getAdNum() {
dat = new Date();
dat = (dat.getTime()+"").charAt(8);
if (dat.length == 1)
ad_num = dat%ads.length;
else
ad_num = 0;
return ad_num;
var ads = new adArray(
"img1.jpg","http://www.domain.com",
"img2.jpg","http://www.domain.com",
"img3.jpg","http://www.domain.com");
var ad_num = getAdNum();
document.write('<div align="center"><A HREF="'+ads[ad_num].href+'" target="_blank"><IMG SRC="'+ads[ad_num].src+'" '
+'BORDER=0 name=js_ad></A></div>');
link_num = document.links.length-1;
function rotateSponsor() {
if (document.images) {
ad_num = (ad_num+1)%ads.length;
document.js_ad.src = ads[ad_num].src;
document.links[link_num].href = ads[ad_num].href;
setTimeout("rotateSponsor()",4000);
setTimeout("rotateSponsor()",4000);
// -->
</script>
Any ideas?Here is the script I finally got working! It would have not came to me without your help guys!
<script>
var pictureWebPartName="Pictures"; // name of the picture library web part
var showThumbnails = true; //otherwise show full sized images
var randomImg = true; //set to true to show in random order
var useCustomLinks = false; //true to use second column as URL for picture clicks
var RotatingPicturesLoopTime = 5000; //2000 = 2 seconds
var imgToImgTransition = 1.0; //2 = 2 seconds
// don't change these
var selectedImg = 0;
var imgCache = [];
var imgTag;
function RotatingPictures()
imgTag = document.getElementById("RotatingImage");
//Find the picture web part and hide it
var Imgs = [];
var x = document.getElementsByTagName("TD"); // find all of the table cells
var LinkList;
var i=0;
for (i=0;i<x.length;i++)
if (x[i].title == pictureWebPartName)
// tables in tables in tables... ah SharePoint!
LinkList = x[i].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
// hide the links list web part
LinkList.style.display="none";
break;
if (!LinkList)
document.all("RotatingImageMsg").innerHTML="Web Part '" + pictureWebPartName + "' not found!";
//Copy all of the links from the web part to our array
var links = LinkList.getElementsByTagName("TR") // find all of the rows
var url;
var len;
for (i=0;i<links.length;i++)
//if (links(i).id.match("row")!=null)
if (links[i].childNodes[0].className=="ms-vb2")
len=Imgs.length
Imgs[len]=[]
Imgs[len][0] = links[i].childNodes[0].childNodes[0].href;
if (useCustomLinks)
if (links[i].childNodes[1].childNodes.length>0)
{ Imgs[len][1] = links[i].childNodes[1].childNodes[0].href; }
else
{ Imgs[len][1] = "" }
if (Imgs.length==0)
document.all("RotatingImageMsg").innerHTML="No images found in web part '" + pictureWebPartName + "'!";
for (i = 0; i < Imgs.length; i++)
imgCache[i] = new Image();
imgCache[i].src = Imgs[i][0];
if (useCustomLinks)
imgCache[i].customlink=Imgs[i][1];
RotatingPicturesLoop();
// now show the pictures...
function RotatingPicturesLoop()
if (randomImg)
selectedImg=Math.floor(Math.random()*imgCache.length);
if (document.all){
imgTag.style.filter="blendTrans(duration=" + imgToImgTransition + ")";
imgTag.filters.blendTrans.Apply();
url=imgCache[selectedImg].src
if (useCustomLinks)
{ RotatingImageLnk.href=imgCache[selectedImg].customlink; }
else
{ RotatingImageLnk.href = url; }
if (showThumbnails)
// convert URLs to point to the thumbnails...
// from airshow%20pictures/helicopter.jpg
// to airshow%20pictures/_t/helicopter_jpg.jpg
url = revString(url);
c = url.indexOf(".");
url = url.substring(0,c) + "_" + url.substring(c+1,url.length);
c = url.indexOf("/");
url = url.substring(0,c) + "/t_" + url.substring(c,url.length);
url = revString(url) + ".jpg";
imgTag.src = url;
if (document.all){
imgTag.filters.blendTrans.Play();
selectedImg += 1;
if (selectedImg > (imgCache.length-1)) selectedImg=0;
setTimeout(RotatingPicturesLoop, RotatingPicturesLoopTime);
// utility function revString found here:
// http://www.java2s.com/Code/JavaScript/Language-Basics/PlayingwithStrings.htm
function revString(str) {
var retStr = "";
for (i=str.length - 1 ; i > - 1 ; i--){
retStr += str.substr(i,1);
return retStr;
// add our function to the SharePoint OnLoad event
_spBodyOnLoadFunctionNames.push("RotatingPictures");
</script>
<!-- add your own formatting here... -->
<center>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td id="VU" height="125" width="160" align="center" valign="middle">
<a name="RotatingImageLnk" id="RotatingImageLnk" alt="click for larger picture">
<img src="/_layouts/images/dot.gif" name="RotatingImage" id="RotatingImage" border=0>
</a>
<span name="RotatingImageMsg" id="RotatingImageMsg"></span>
</td>
</tr>
</table>
</center>
Thanks again guys! -
HELP, Convert PDF to Flash book with flipping effect.
Hello everyone, I want find a software to helps me convert my local PDF files into flash playbook, with page flipping effect.
It is better, if software can:
1.Freeware
2.Add links and images
3.output Flipbook can be viewed on mobile device
Please help me out.
(I find ideal software, it named Flipbook Ceator)
Thank you all!you want that authoring app on a BlackBerry phone ? not on Windows ?
The search box on top-right of this page is your true friend, and the public Knowledge Base too: -
Microsoft Internet Explorer appears to have created a small
issue for flash buttons. You have to click on it twice to get it to
play. Does anyone out there know how to get around this
issue?http://blog.deconcept.com/swfobject/
Adobe site has another version of a fix
"Bops_S" <[email protected]> wrote in
message
news:etci1i$7a9$[email protected]..
> Hi folks. I built a website on my MAC using Dreamweaver
MX-2004 and used
> some
> of the standard flash buttons for the menus. The site
works great on my
> MAC
> using Safari and FireFox browsers but when I go to try
the site from a
> Windows
> PC using IE 6/7, I have to double click the buttons for
them to work. It
> looks
> like the first click selects the button and the second
click will depress
> the
> button and take you to the relevant page. Here is the
url if you want to
> check
> out what I'm talking about
http://www.sequinda.com This has
been driving
> me
> mad and I would really appreciate some help in sorting
this out.
>
> thanks
> Bops
> -
Flash button with dynamic text
I'm trying to create a flash button so that it can toggle
between "Sound On" and "Sound Off" but I feel like I'm doing
something wrong and it errors out on me.
I have a button on stage as, and in my up/over/down/hit in
different colors I have a dynamic text field identified as
sound_txt.
Here's the script I have so far for my frame:
stop();
mutebtn.addEventListener(MouseEvent.CLICK,muteDo);
function muteDo(event:MouseEvent) {
if (mutebtn.sound_txt.text == "Sound Off") {
mutebtn.sound_txt.text = "Sound On";
} else {
mutebtn.sound_txt.text = "Sound Off";
and this is the error message I am getting:
TypeError: Error #1010: A term is undefined and has no
properties.
at buttontst_fla::MainTimeline/muteDo()
TypeError: Error #1010: A term is undefined and has no
properties.
at buttontst_fla::MainTimeline/muteDo()
Can someboy please advise as to how I can get this to
work?I tried bringing the textfield out of the button but while it
worked when I pressed the button portion that is not under the
text, it was the part of the text that got in the way from doing
anything. I wonder where I can find an existing example that works
the way I want it too so I can at least follow that example. I
think I tried making the dynamic text a movie clip but was still
getting similar errors.
Edit: I at least got it to work by converting the button into
a movie clip although I had also wanted it so that I could also
change the foreground color of the dynamic text upon rollover,
etc. -
hi
I have a problem. I want to link my flash menu with typo3 and
I don't know what i should do.
Please help he, I'm very desperate.
Sincerely Miatypo3?
Dave -
www.offroadfire.com
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/ -
hi,
I want to create a flash button,& for the button
different images should load for press & release events. also I
want to reuse this button. Please can someone tell me how to do
thatyou'll need to use server-side scripting to handle part of the file upload and the file name retrieval from the upload folder. assigning the uploaded files names you'll do from flash. you'll use another script to retrieve the file names and in flash load and display which ever subset you want.
-
Problem With Fade Effect For JTextField
Hello Friends !
I am putting a 'bounty' of 10 Duke dollars
for the clever clogs who can help me out !
I want to create a 'fade in' effect when a
textfield has the focus and a 'fade out'
effect when it looses focus.
The code for what I have done so far is
listed below, but it leaves nasty 'artifacts'
behind when painting.
regards, Asad.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class RunProgramAgain{
public static void main(String[] args){
JFrame frame = new MyFrame();
class MyField extends JTextField{
public MyField(){
setPreferredSize(new Dimension(100, 30));
public void paintComponent(Graphics g){
super.paintComponent(g);
if(hasFocus())
fadeIn();
else
fadeOut();
private synchronized void fadeIn(){
for(alpha = MIN; alpha <= MAX; ++alpha)
setBackground(new Color(RED, GREEN, BLUE, alpha));
private synchronized void fadeOut(){
for(alpha = MAX; alpha >= MIN; --alpha)
setBackground(new Color(RED, GREEN, BLUE, alpha));
private int alpha = MIN;
private static final int MIN = 0;
private static final int MAX = 10;
private static final int RED = 0;
private static final int GREEN = 255;
private static final int BLUE = 0;
class MyButton extends JButton{
public MyButton(){
super("Start");
class MyFrame extends JFrame{
public MyFrame(){
setSize(new Dimension(300,250));
getContentPane().setLayout(new FlowLayout());
getContentPane().add(new MyButton());
getContentPane().add(new MyField());
show();
}Played some more and came up with a class that will allow you to fade the background color of any JComponent:
import java.awt.*;
import java.awt.event.*;
import java.util.Hashtable;
import java.util.Vector;
import javax.swing.*;
public class Fader
private static final int MIN = 0;
private static final int MAX = 10;
private Color fadeFrom;
private Color fadeTo;
private Hashtable backgroundColors = new Hashtable();
** The background of any Component added to this Fader
** will be set/reset to the fadeFrom color.
public Fader(Color fadeTo, Color fadeFrom)
this(fadeTo);
this.fadeFrom = fadeFrom;
** The original background of any Component added to this Fader
** will be preserved.
public Fader(Color fadeTo)
this.fadeTo = fadeTo;
** Fading will be applied to this component on gained/lost focus
public Fader add(JComponent component)
// Set background of all components to the fadeFrom color
if (fadeFrom != null)
component.setBackground( fadeFrom );
// Get colors to be used for fading
Vector colors = getColors( component.getBackground() );
// FaderTimer will apply colors to the component
new FaderTimer( colors, component );
return this;
** Get the colors used to fade this background
private Vector getColors(Color background)
// Check if the color Vector already exists
Object o = backgroundColors.get( background );
if (o != null)
return (Vector)o;
// Doesn't exist, create fader colors for this background
int rIncrement = ( background.getRed() - fadeTo.getRed() ) / MAX;
int gIncrement = ( background.getGreen() - fadeTo.getGreen() ) / MAX;
int bIncrement = ( background.getBlue() - fadeTo.getBlue() ) / MAX;
Vector colors = new Vector( MAX + 1 );
colors.addElement( background );
for (int i = 1; i <= MAX; i++)
int rValue = background.getRed() - (i * rIncrement);
int gValue = background.getGreen() - (i * gIncrement);
int bValue = background.getBlue() - (i * bIncrement);
colors.addElement( new Color(rValue, gValue, bValue) );
backgroundColors.put(background, colors);
return colors;
class FaderTimer implements FocusListener, ActionListener
private Vector colors;
private JComponent component;
private Timer timer;
private int alpha;
private int increment;
FaderTimer(Vector colors, JComponent component)
this.colors = colors;
this.component = component;
component.addFocusListener( this );
timer = new Timer(5, this);
public void focusGained(FocusEvent e)
alpha = MIN;
increment = 1;
timer.start();
public void focusLost(FocusEvent e)
alpha = MAX;
increment = -1;
timer.start();
public void actionPerformed(ActionEvent e)
alpha += increment;
component.setBackground( (Color)colors.elementAt(alpha) );
if (alpha == MAX || alpha == MIN)
timer.stop();
public static void main(String[] args)
// Create test components
JComponent textField1 = new JTextField(10);
JComponent textField3 = new JTextField(10);
JComponent textField4 = new JTextField(10);
JComponent button = new JButton("Start");
JComponent checkBox = new JCheckBox("Check Box");
JFrame frame = new JFrame("Fading Background");
frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
frame.getContentPane().add(textField1, BorderLayout.NORTH );
frame.getContentPane().add(button, BorderLayout.SOUTH );
frame.getContentPane().add(textField3, BorderLayout.EAST );
frame.getContentPane().add(textField4, BorderLayout.WEST );
frame.getContentPane().add(checkBox);
// Fader preserving component background
Fader fader = new Fader( new Color(155, 255, 155) );
fader.add( textField1 );
fader.add( button );
fader.add( checkBox );
// Fader resetting component background
fader = new Fader( new Color(155, 255, 155), Color.yellow );
fader.add( textField3 );
fader.add( textField4 );
frame.pack();
frame.setVisible( true );
} -
Hi there,
I'm trying to build a navigation sysytem like this:
http://www.bisazza.it/eng/index.html
(the one running along the bottom of the page).
The best I can do is here, though its not working properly:
http://www.giraffeads.com/clients/nz/button_test_3.htm
The flash file is here:
http://www.giraffeads.com/clients/nz/working/navigation_280406.fla
I'm using the following action script:
on (rollOver) {
this.gotoAndPlay("mouseover");
on (rollOut) {
this.gotoAndPlay("mouseout");
on (release) {
getURL("
http://www.odysseyphotography.net");
..applied to an instance of the movie on the stage.
There are a couple of issues:
1) When you mouseover the button, the text moves downwards
but doesn't remain in that position (like:
http://www.bisazza.it/eng/index.html)
2) If you move the mouse away then back again the movie
restarts before finishing (resulting in jerky up and down movement)
3) You have to get the mouse exactly over the text for it to
work.. It'll be difficult to make it link to another page...
Any assistance or links to a tutorial would be much
appreciated!
Thanks
OPadd this to you movi clip
onClipEvent(enterFrame) {
if(this.hitTest(_root._xmouse,_root._ymouse))
this.nextFrame();
else this.prevFrame();
on (release) {
getURL("
http://www.hotmail.com");
AND remove the "mousout" all frames in the movie clip,
Add a invisible rectangle behind the text for area you want
to sence with mouse
you can do it by draw rectangle > color mixer > alpha
to 0%
Then it's work finly, still if u dont understnd send me ur
email and ill send the fla
sorry, my bad english :-)
Ayubowan!
Nalinda -
Update Content with fade effect - How do I do this in 1.5?
Hello,
Just wondering what would be the equivalent code in spry 1.5
to the following update content with effect code in 1.4?
function fadeIt(ele,url){
Spry.Effect.DoFade('apDiv1',{ duration: 500, from: 100, to:
0, finish: function() {
Spry.Utils.updateContent(ele, url, function() {
Spry.Effect.DoFade('apDiv1',{ duration: 500, from: 0, to:
100 });
I am a little stumped how to achieve this now that the effect
code must be BELOW the html region the effect code works on. Any
help on this would be appreciaed.
Regards,
Kiwwwi.Hi,
We have a special article that explains the changes from
Spry1.4 to Spry 1.5 regarding the effects.
You can find it
here.
Diana
Maybe you are looking for
-
COnnecting 4th Generation Ipod to Alpine...
My U2 edition works on firewire not USB and won't work with my new stereo... is there a firmware update or something to make it work with USB? thanks.... John
-
Export from iPhoto to Cpmpact Flash Card
I am so frustrated. We got one of those new [icture frames that you can put a flash card in. When I select the photoes from iphoto and export them to the card I get an error early into the transfer Unable to create/Volumes/ after a few pics, never th
-
Os8.6 being crazy / virtual pc patches
1)Since installation of mexican spanish speech for my pb3400 i cannot use the context menu and select more than one object(appears one hand) I came back the english speech but the problems continues. edit:Now i cannot use the built-in keyboard(letter
-
How can I edit html in iWeb?
-
Safari constant crashing on Macbook Pro
Hi, Safari is constantly crashing on my MacBook Pro. I have used migration assistant to transfer my user and network data but the problem did not seem to start until I updated to 10.4.6. I have tried all the tips on other posts (deleting icon folder,