Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Using Ease With Framerate Independent Animation



hello, i've recently started trying to impliment framerate independent animation in my work. i get it to work and understand it, HOWEVER, i am having trouble figuring out how to add an Ease In and Ease Out variable into the mix. ideally, i would like to use a similar scale that flash MX uses, setting the var "ease" +/- 100

since this animation is time based, i'm having trouble tacking it on to my current code. i've tried to comment it out, but i'd be happy to elaborate further.


Code:
function slideMyClip (myClip, totalTime, totalDis, ease) {

//myClip = clip to target the actions to
//ease = value -100 to 100 to control ease in or out. 0 = no ease
//totalTime = the time for the movement to take
//totalDis = the total x distance to travel


myOnTime = getTimer ();
moveTime = totalTime;
xPos = this[myClip]._x;
this[myClip].onEnterFrame = function () {

var timePassed = getTimer () - myOnTime;
if (timePassed < moveTime) {
this._x = xPos + (totalDis * (timePassed / moveTime));
} else {
this._x = xPos + totalDis;
play();
delete (this.onEnterFrame);
}//if

}//enterFrame

}
thanks,

jwt



FlashKit > Flash Help > Flash ActionScript
Posted on: 07-16-2003, 01:50 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

ActionScript Animation Independent Of Framerate
Hi everybody. I'm working on a small piece of ActionScript to help me do motion tweens dynamically. Currently, it uses frames as time input, but I would like to make that seconds.

I'm aware that there are good tweening classes available that do this already, but I simply want to learn how to do this so that I can use it for other things as well.

This is the code so far (simplified and void of unnecessary things):
Code:

function runDemo():Void
{
    MovieClip.prototype.tween = function(a:String, b:Number, f:Number, d:Number):Void
        {
            var c:Number = f - b;
            var t:Number = 0;
            this.onEnterFrame = function()
                {
                    this[a] = ease_quinticInOut(t++, b, c, d);
                    if  (t > d)
                        delete this.onEnterFrame;
                };
        };
   
    function ease_quinticInOut(t:Number, b:Number, c:Number, d:Number):Number
        {
            var ts:Number = (t /= d) * t;
            var tc:Number = ts * t;
            return b + c * (6 * tc * ts + -15 * ts * ts + 10 * tc);
        };
       
    myMovieClip.tween("_x", 0, 150, 30);
};

runDemo();

As you can see, it tweens myMovieClip in 30 frames. I'd like that to be one second, so that processor lag isn't a factor when I start using this code. I hope you can help me!

AS3 - Framerate Independent Game
im trying to switch my game, that is using onEnterFrame to update the game, over to a timer based update so it will be frame rate independent. how is something like this achieved?

Timer For Minutes/Seconds Independent Of The FrameRate
Howdy folks,

maybe sumone can help me out ... I need an Timer which starts counting on Buttonpress in secs:millisecs ... But independent from the Framerate (my movie has to run by 30 FPS)

maybe sumone has a codesnippet for me ...

thanx in advance

Independent Animation
I need a little help animating, I am still earning how to animate and I would like to have multiple characters (all the same) run across the screen, but I dont want to have to create a new keyframe for each diffrent animation. Is it possible to create an object that changes between animations on its own or something of the like? Thanks.

Scaled Animation Slows Framerate
I have a 3D animation done with swift3D and imported in flash.
If i don;t scale it, works fine... but if i do (to fit the page - full screen), the framerate drops like a brick.
Can anyone tell me why?

Easing An Animation Running Without Ease
hi all,
I'm not a code expert, so I guess to find here some help.
I need some advise to build a function that slow down and stop an animation that is running cyclical (from right to left) in the back of my stage, without any other effect. The issue is that the slow-and-stop command can come at any time ('cause it will depends on user's click on a button).
My animation is very _x-long: it something like a scene running in the bottom of the screen, and it must slow and stop when the command come,

I tried with tween class, with setInterval, but the only way I can try is valid for a short animation, cycling from right to left and then going back to its original _x position. But this is unuseful for a long scene...

please help me
thanking you in advance

AS2 Easing An Animation Running Without Ease
hi all,
I'm not a code expert, so I guess to find here some help.
I need some advise to build a function that slow down and stop an animation that is running cyclical (from right to left) in the back of my stage, without any other effect. The issue is that the slow-and-stop command can come at any time ('cause it will depends on user's click on a button).
My animation is very _x-long: it something like a scene running in the bottom of the screen, and it must slow and stop when the command come,

I tried with tween class, with setInterval, but the only way I can try is valid for a short animation, cycling from right to left and then going back to its original _x position. But this is unuseful for a long scene...

please help me
thanking you in advance

Using SetInterval() To Execute Animation Faster Than Framerate
Earlier we discussed making an animation movie clip independent of frame
rate and used the following code in the first frame of a movie clip (call it
"mc"):

var interval_between_frames=100;
var interval_between_frames_reference;
if (interval_between_frames_reference)
{
clearInterval(interval_between_frames);
}
interval_between_frames_reference = setInterval(this, "nextFrame",
interval_between_frames);
stop();
and put stop(); into the rest of the frames of mc.

However this work one direction only - it can slow down the speed of the
animation below the framerate, but it cannot increase it above the frame
rate.

I.e. if in my FLA file I have an mc with the above code and in the main time
line I place
attachMovie("mc","mc",depth)
and set the framerate of my FLA to 1, the mc executes at 1 fps
irrespective of value of interval_between_frames.

Why is that and how can I use setInterval() to execute faster than
framerate?

Timeline Animation Problems, Mismatched Framerate.
I am working with a old timeline based animation at 12 fps that i have to bring into a new timeline that is 30 fps. Is there any way to increase the frame rate on the old movie and have the appropriate keyframes increased in length to match the new frame rate??

Thanks for any help you can give.

Ease Animation Function - Evil Event Listeners
Last question before i turn in for the night

I've been working on a node class, which places a circle on the stage and holds information about it, such as ID and coordinates etc.

I've been working on an ease animation function for the class, so i can animate each node to a certain y location on the stage with a nice slow down as it reaches its target destination (sadly, i'm not sure how to apply this for BOTH x and y).

I have no idea how the ENTER_FRAME event listeners work, so this was my longshot attempt:


ActionScript Code:
public function easeNode($destination:Point)        {            var previousPosition:Point = new Point(node.x,node.y);            var speed:int = randRange(4,12);            node.addEventListener(Event.ENTER_FRAME, animation);                        function animation (e:Event):void  {                             node.y += ($destination.y - node.y)/speed;                if( node.y == previousPosition.y) {                    node.y = $destination.y;                    animation.removeEventListener(Event.ENTER_FRAME, animation);                }                previousPosition.y = node.y;            }        }


Useage:


ActionScript Code:
nodes[2].easeNode(new Point(43,34));


I'm getting this error at compile:


Quote:




Description:
1046: Type was not found or was not a compile-time constant: Event.

Source:
function animation (e:Event):void {




Can one of you AS3 gurus out there set me straight and point out my errors?

Thanks again guys, you're the best!

Framerate Of Loaded SWF Changing Framerate Of Main Movie?
I don't understand why this is happening, as everywhere I read said this was impossible, but - I have my main movie defined as 24fps.

I use the following code to load in an SWF that happens to be 12fps.

ActionScript Code:
_root.ImageLoop.createEmptyMovieClip("anSWF", _root.ImageLoop.getNextHighestDepth());
    _root.ImageLoop.anSWF.loadMovie("./InsulinClip4plasma_12fps_mx.swf");

As I understand it the main movie should control the framerate so I was terribly shocked when I found my main movie runs at 12fps after loading in that swf.

Does anyone know how I can circumvent this?

Thanks!

I Have Code That Will Move Objects With Ease, But How You You Rotate With Ease?
http://www.affixen.com/

is a great example of what i am talking about...

anyone know how to rotate to a stop to an ease?
and if so, my second question would be how to random ease to a stop?

-manny

THANKS A MILLION IN ADVANCE!!!

Video Framerate / Movie Framerate Issues
Hi all,

I have one swf, say "loader.swf", running at 40 fps loading a video swf, say "video.swf", exported from sorensen squeeze running at 25 fps.

Now, what I thought at first was video.swf would adjust to the framerate of loader.swf, like any other swf would, but it seems that if video.swf contains timeline video or sound, loader.swf will conform to the framerate of video.swf ?

When decompiling the swf from sorensen squeeze there´s also a "framerate=25.00000" action at frame 1. Is this some kind of secret movie property, or just a simple way for loader.swf to get the video framerate?

What happens to loader.swf when i unload media.swf? Will it go back to its original framerate?

Couldnt find any info on these slightly puzzling issues, anyone with experience from this?

Nick

About Ease In + Ease Out In Action Script ?
Hi! Every one,

How can I create Tween Motion Ease In & Ease Out in Action Script?

My code to use Tween Motion:


ActionScript Code:
var nInter:Number = setInterval(display,1);
       function display():Void
       {
              mcRetangle._y -=1;
       }


I want mcRetangle Tween Motion with EaseIn or EaseOut, how can I do that?
Thank you so much
Best regards,

Ease-in AND Ease-out Property
I wrote a prototype function that moves a movieclip to a specified location(xPos) with an ease in and an ease out. The way I scriped it, it works every other time but thats it. Half the time the function is called it just performs the ease out. I also attached an fla (MX2004).

My AS breakdown:
When the function is called to a MC it replaces the "ease" var on the "_x += this.ease*speed", to make the script accelerate or ease out determined if the _x is less or more than half way to the xPos.

code:
MovieClip.prototype.ease_in_and_out = function(xPos, speed) {
this.onEnterFrame = function() {
this._x += this.ease*speed;
if (this._x<(xPos/2)) {
this.ease = this._x;
} else {
this.ease = (xPos-this._x);
}
if (Math.round(this._x) == (xPos)) {
this._x = xPos;
delete this.onEnterFrame;
}
};
};
b1.onPress = function() {
myMC.ease_in_and_out(30, .05);
};
b2.onPress = function() {
myMC.ease_in_and_out(800, .05);
};


Could someone rewrite this for me?

Thanks!

[math] Ease In + Ease Out
Hi guys.


Does anyone know (or know where I can get hold of) a function that will do the same thing as easing-in and easing-out a movie clip animation?

Basically what I need to do is feed the function a start position and an end position and have the function return all of the intermediate positions as an array. I know how to get things to ease-out... but not ease-in and ease-out.


Cheers,
Si ++

Independent Fps
i have a background that i move with script

onClipEvent (enterFrame) {
this._x = this._x-1;
if (this._x<-900) {
this._x = 0;
}
}

how can i make tis or any other MC's fps faster or slower than the timeline??

Help - Need Independent Sound
I have a looping action on the root level that swirls text like a tornado, and then lays down the text and later fades it.

I want a continuous "swirling/blowing wind" sound to play as the swirl A.S. plays but the swirling text A.S. has a loop in it that manipulates each letter, one at a time.

The wind sound is a sound object in its own movie clip but this does not seem to help.

The problem is that the text loop ALSO loops the wind sound.

***** How can I get the wind sound to play independently of the text A.S. on the root level ? *****

Please Help.
thanks

Independent Layer
How can I get a layer to play seperate from the rest of the layers.

I'm trying to have music start up at the begining of my movie but then when I use buttons to jump to different frame I dont want it to effect the music.

Can i get some help on this?

Independent Pre Loader
I've a flashmovie with components and attached movies. As I read, this kind of stuff loads in the first frame, always, doesn't matter in which one they are. This way it's impossible to use a pre loader in the same .fla because everything is loading at the same time!
How can I do an independent preloader.fla? Is it possible? If not, what should I do?
Thanks for any help.

Independent Copy Of A MC
Ok, this is pretty basic, but I can't figure it out.

I want to make a copy of a MovieClip and change it's properties without changing the original MC.

To be more precise I want to copy MC2 to MC1, then load the next page into MC2. MC1 should be visible all the time and MC2 not. But by writing

ActionScript Code:
MC1 = MC2;
MC1 becomes a duplicate of MC2 and when properties for one of them are changed, the other one will change as well.

How can I make a real copy of a MC that's independent of the original??

Running Independent SWF
Hi All
I made a desktop application( in AS 3.0 using Flash IDE) in which I am loading bunch of SWFs in my UILoader. The file is working fine from Flash Authoring tool( IDE). I publish my file using local files only. Now when I am trying to run my independent SWF file, i am getting error
"Error #2044: Unhandled ioError:. text=Error #2035: URL Not Found. URL: file:///video/pic_8.swf".
The things are working fine if i open fla and hit ctr+Enter.I don't know why its not working as an independent swf. Also the title of the player is showing player 9, which means it is using the player it is supposed to use.
If i change my publish settings to
network only nothing works at all.
i am just using XML to load external SWFs and videos in UIloader component.
Any body has any solution for this kind of problem.
I am putting all my code on main time line in Flash authoring tool and my Operating system is XP
Thanks a lot.
Anuj

Independent Functions
Hi everybody.. I'm trying to create a cool effect in Flash...Its like a button expand, or something like that... I mean, you rollOver a button, it grows with easing or bounce effects, and the other buttons next to it, move like giving pass to the new scale...
The problem is my .fla, I asign a grow-expand function to each button, that is called on rollOver, and on RollOut it returns with other function. But, when I rollOver inmediately other button, the last function stops and the effect is lost... How can I do that in a best way???
Here is my fla if you can help me...

Running Independent SWF
Hi All
I made a desktop application( in AS 3.0 using Flash IDE) in which I am loading bunch of SWFs in my UILoader. The file is working fine from Flash Authoring tool( IDE). I publish my file using local files only. Now when I am trying to run my independent SWF file, i am getting error
"Error #2044: Unhandled ioError:. text=Error #2035: URL Not Found. URL: file:///video/pic_8.swf".
The things are working fine if i open fla and hit ctr+Enter.I don't know why its not working as an independent swf. Also the title of the player is showing player 9, which means it is using the player it is supposed to use.
If i change my publish settings to
network only nothing works at all.
i am just using XML to load external SWFs and videos in UIloader component.
Any body has any solution for this kind of problem.
I am putting all my code on main time line in Flash authoring tool and my Operating system is XP
Thanks a lot.
Anuj

Independent MC Quality
'Sup, guys?

Is it possible to set the quality of individual movie clips independently?
Here's what the manual says:

Quote:




This example sets the rendering quality of a movie clip (and subsequently the entire SWF containing the movie clip) named my_mc to LOW:

PHP Code:



my_mc._quality = "LOW"; 









I would further add to the "...and subsequently the entire SWF containing the movie clip..." that the setting of that my_mc would also affect the parent SWF if the SWF containing it is in turn externally loaded into another SWF.

If setting the ._quality property of a single MC affects the entire SWF and EVEN the parent SWF, then why have it in addition to the global _quality property? I mean, what's the freakin' use if it does the exact same freakin' thing? (Doesn't it?)

Thanx

Independent Layer
Someone please help. No one answers my posts on here. How can I make a layer that will not loop with the movie. I am moving an object with actionscript in the first frame but when the movie restarts, it restarts also.

Independent Sound Manipulation
I have 3 sound objects which are playing simultaneously and want to adjust the volume for each object independently using the setVolume method. I'm starting simple by using a mute/unmute button for each object, but when I mute one object the others also mute - any ideas on how to get around this?

Selecting The Independent Characters.
Hi,
Is it possible to select any single character from a big word in a textfield dynamically.
regards,
Praveen.

Time Independent Layer....please Help
Is it possible to make a quasi "time-independent" layer in flash (for drop dpwn buttons, etc)? when i make the drop downs, the play head keeps jumping to the frame with the appropriate submenus, but then everything else is changing (with the playhead). Is their any technique you can use to maybe make the drop down buttons time independent, so that by activating their script, the playhead doesn't jump to another part of the movie so that everything else vhanges as well?

thanks!

Playing An MP3 Independent Of Frames
I am modifying the basic slideshow that came with MX. I would like to have an MP3 play along with the slideshow. However, if I attach it to the first keyframe everything is fine until the slideshow arrives back at the first frame at which point a second copy of the MP3 begins playing over itself. This also happens if I hit the back key and traverse the first keyframe. I tried adding a separate scene independent of the slideshow keyframes but that didn't work.

How do I load an MP3 to play independent of the current frame? Is there an "onload" function in Flash?

Thank you,

Seth

Loading Independent Images
Hello everyone

I have a movie located here...

www.paraisocz.com/test.html

What I want to do is to let each of those three image windows to rotate a set of separate images independently of each other using actionscript.

In other words, the image window on the left will be rotating about 5 to 10 images while the image in the middle will do the same but with a different set of images and the same for the image window on the right.

Can someone help or lead me to a good site for assistance?

Please bare with the slow loading. I haven't built a preloader yet.

Thanks
Dave

Independent Browser Window
Something I saw a little while ago and got me curious about

a site that, when it runs the flash, it opens a window with its own top and scroll, independent of the browser been used

Im not sure of where I saw it (was a while ago) but I think at least one case was in the list of sites here

anyone knows how to do that?

- K

Breakpoint At Independent AS File?
Just curious, is anyone able to enable breakpoint at independent AS file?

I can add breakpoint within the main .fla file, but cannot add any breakpoint at .as file.

Any hint?

Independent Frame Rates
I have a question regarding frame rates.

Can you make a Movie Object with an independent frame rate from the scene that Movie Object is present in?

Example:

Movie Frame Rate: 3 fps
Scene Frame Rate: 12 fps

Any help would be appreciated!

Thanks,
Dave

Independent Flash Player?
I hope I posted this on the correct forum.

Anyway, I was wondering if there is a program that could play .swf files automatically (kinda autoplay effect) after you insert a disk in a pc without a web flash player installed, or any type of flash player to that matter.

Connect Two Independent .swf Files.
I just want to know, is their any method by which two .swf files of got from two separate .Fla movies. Actually my both .swf files are of huge size ( obviously the corresponding .Fla files also, 8 MB each). So i cannot use single .Fla and combine them. Presently i have to run both .swf files separately to run the single movie, while i want that, i should run single .swf, and the second one runs automatically, after the first one gets finished. Please help.

Independent Clip Actions
Ok, so my Actionscript skills are slowly returning! Still can't seem to get this work right and was wondering if someone could tell me what I'm doing wrong. I'm using MX and got three instances of the same movie clip on three different layers. What I need to happen is if you click on any one it stops and plays a particular loop of frames while the others continue regularly. If you click that same one again it continues playing... all of this independent of what the other two clips are doing! So my question is how to get the clips to behave independently? And how do I get it the clicked movie clip to continuously loop through these particular sets of frames labeled "pause1/endpause1", "pause2/endpause2", etc.). Thanks in advance

The .fla is attached.

Independent Frame Rates
Is there a way to have a Flash movie have an independent frame rate? My main movie has a frame rate of 12, but on level2 I am trying to load a movie that contains an .flv which runs at 25fps. Played on it's own, this level2 movie works fine but if it is called up from within the main movie, it seems to take on the main movie's frame rate because the animation is in slow motion.

So is there a way I can tell the main movie to use the frame rate of the movie being loaded?

I hope that makes sense.

Independent Clip Movement...
Moving a single movie when clicked works well, but placing two of the clips on the frame results in both movies moving even when only one has been clicked.

I expected an instance of this class for each independent instance of the symbol, and each clip being moved by itself when clicked.

MyMovieSymbol.as:

code:
class MyMovieSymbol extends MovieClip
{
function onMouseDown()
{
_x = _x+5;
}
}


I am lacking a fundamental understanding here...; thanks for your help.

My Fonts Have Independent Minds
So ALL my fonts are static text boxes and I have even embeded the font into my library but somehow....one of my rollovers drops a subnav down and the font is different on different computers. I am using Flash8. Is there a way to avoid this?????? I seem to always have trouble getting art to import clean....and fonts ( and leading) to stay the way I want it......HELP.

Importanting An 'independent' Swf File Into My FLA
(flash version CS3, using AS2).

Hi guys

I've been customizing a quiz (which I pulled off the flashkit archive) today which stands alone in it's own fla, on the timeline.

The trouble is, this quiz will need to be intergrated into an interface I am currently building in Flash. If I attempt to import it either as a movieclip (by manually copying all layers and creating a new symbol) or loading the swf from the library, by using loadMovie i get all sorts of actionscript conflictions.

I guess what I am asking, is there any specific way that I can import an external swf which stands on its own, without communicating with the main timeline AS. Because at the moment an array within the quiz is trying to talk to the _root (of the whole fla) and not it's own timeline.

Sorry for the newb question, I've never come across this issue before.

Any help would be wonderful, thanks.

XML Buttons - How To Make Them Act Independent
I am trying to create an array of buttons, based on an xml doc. I have it so that the buttons load in and position themselves correctly. These buttons are from a MC in the library with the VideoButton() class. Within each of these are 3 states (set by frame labels), btnRest, btnOver and btnActive.

My FIRST problem is that the buttons dont act as individuals all the time. example is that the rollOver only works on the last button created.

I also cant get the text color to change for the different states. Any ideas?

On CLICK i want them to load a video into a video player which i have already created and will add to this later. but after the button is clicked and the appropriate video is loaded i want that button to be disabled

any ideas or help would be great, thanks

XML Doc:

Code:
<playlist>
<vid source="video/video1.flv" thumb="thumbnails/Image1.jpg" desc="button 1" length="2:10">Description of Video 1.</vid>
<vid source="video/video1.flv" thumb="thumbnails/Image2.jpg" desc="button 2" length="2:20">Description of Video 2.</vid>
<vid source="video/video1.flv" thumb="thumbnails/Image3.jpg" desc="button 3" length="2:30">Description of Video 3.</vid>
</playlist>
AS3:

Code:
var imageText:TextField = new TextField();

var imageLoader:Loader;
var xml:XML;
var xmlList:XMLList;
var xmlLoader1:URLLoader = new URLLoader();
xmlLoader1.load(new URLRequest("includes/images.xml"));//"includes/page1.xml"));

var firstButton:VideoButton = new VideoButton();

xmlLoader1.addEventListener(Event.COMPLETE, xmlLoaded);

function xmlLoaded(event:Event):void
{
xml = XML(event.target.data);
xmlList = xml.children();
for(var i:int = 0; i < xmlList.length(); i++)
{
firstButton = new VideoButton();
firstButton.btnTxt.htmlText = "<font color='#444444'>" + String(xmlList[i].attribute("desc")) + "</font>";
firstButton.btnTxtTime.htmlText = "<font color='#888888'>" + String(xmlList[i].attribute("length")) + "</font>";
firstButton.x = 0;
firstButton.y = 217 + ((i * 36) - 0.5);
firstButton.name = xmlList[i].attribute("source");
addChild(firstButton);
firstButton.addEventListener(MouseEvent.CLICK, loadVideoPlayer);
firstButton.addEventListener(MouseEvent.MOUSE_OVER, overBtn);
firstButton.addEventListener(MouseEvent.MOUSE_OUT, outBtn);
//trace(event.target.name);


function overBtn(event:MouseEvent):void {
firstButton.gotoAndPlay("btnOver");
}

function outBtn(event:MouseEvent):void {
firstButton.gotoAndPlay("btnRest");
}
}



}

function buildButtons() {

}

function loadVideoPlayer(event:MouseEvent):void
{
imageLoader = new Loader();
imageLoader.load(new URLRequest(event.target.name));
imageLoader.x = 200;
imageLoader.y = 25;
addChild(imageLoader);
imageText.x = imageLoader.x;
imageText.y = 351;
for(var j:int = 0; j < xmlList.length(); j++)
{
if(xmlList[j].attribute("source") == event.target.name)
{
imageText.text = xmlList[j];
}
}
}
imageText.autoSize = TextFieldAutoSize.LEFT;
addChild(imageText);

Independent Background Images
Ok, Im building a website with a portfolio section. so when you click on a thumbnail image, it becomes the background image. I also want to keep the current background image from that frame when I go to another part of the site, such as "news"
example: you go to portfolio, click on a thumbnail image of a lamp. The lamp becomes the background. Then you click on "news" and the lamp continues to be the background. So the only way to change the background image is to go to the portfolio section and click on a different thumbnail image in the "portfolio" section.

Any ideas on the best way to go about this/set it up?

Is Flash Really Browser Independent?
Most of us in the development world like flash because of that wonderful buzzword... "browser independent." What's that mean? Simply put, no more fighting to make things behave the same on different browsers with things like javascript.

However, I have a huge problem. In developing a widget here at work, I came across a massive timing difference. Here, take a look in IE and Firefox at the following link:

http://www.calacademy.org/staging/newsite/events/

Literally, the firefox side is twice the speed! HELP! (please)

Independent Child Properties?
Hi - I'm wondering if it's possible to make some properties of a child independent from its parent in the Display List.

I have a Sprite subclass with an alpha value of 0.5, but create a child of this class whose alpha I'd like to be 1. I would like, however, for the rest of the properties (location, etc.) of the child to be controlled by the parent. Is there a good way to do this? Thanks for any suggestions!

PDF Pages To Independent SWFs
I need a way, hopefully someprogram, that will allow me to export PDF documents to SWFs so that each page of PDF is an independent SWF-file. From acrobat you can export to JPGs and various other formats but no SWF available.

XML Buttons - How To Make Them Act Independent
I am trying to create an array of buttons, based on an xml doc. I have it so that the buttons load in and position themselves correctly. These buttons are from a MC in the library with the VideoButton() class. Within each of these are 3 states (set by frame labels), btnRest, btnOver and btnActive.

My FIRST problem is that the buttons dont act as individuals all the time. example is that the rollOver only works on the last button created.

I also cant get the text color to change for the different states. Any ideas?

On CLICK i want them to load a video into a video player which i have already created and will add to this later. but after the button is clicked and the appropriate video is loaded i want that button to be disabled

any ideas or help would be great, thanks

XML Doc:
Code:

<playlist>
   <vid source="video/video1.flv" thumb="thumbnails/Image1.jpg" desc="button 1" length="2:10">Description of Video 1.</vid>
   <vid source="video/video1.flv" thumb="thumbnails/Image2.jpg" desc="button 2" length="2:20">Description of Video 2.</vid>
   <vid source="video/video1.flv" thumb="thumbnails/Image3.jpg" desc="button 3" length="2:30">Description of Video 3.</vid>
</playlist>


AS3:
Code:

var imageText:TextField = new TextField();

var imageLoader:Loader;
var xml:XML;
var xmlList:XMLList;
var xmlLoader1:URLLoader = new URLLoader();
xmlLoader1.load(new URLRequest("includes/images.xml"));//"includes/page1.xml"));

var firstButton:VideoButton = new VideoButton();

xmlLoader1.addEventListener(Event.COMPLETE, xmlLoaded);

function xmlLoaded(event:Event):void
{
   xml = XML(event.target.data);
   xmlList = xml.children();
   for(var i:int = 0; i < xmlList.length(); i++)
   {
      firstButton = new VideoButton();
      firstButton.btnTxt.htmlText = "<font color='#444444'>" + String(xmlList[i].attribute("desc")) + "</font>";
      firstButton.btnTxtTime.htmlText = "<font color='#888888'>" + String(xmlList[i].attribute("length")) + "</font>";
      firstButton.x = 0;
      firstButton.y = 217 + ((i * 36) - 0.5);
      firstButton.name = xmlList[i].attribute("source");
      addChild(firstButton);
      firstButton.addEventListener(MouseEvent.CLICK, loadVideoPlayer);
      firstButton.addEventListener(MouseEvent.MOUSE_OVER, overBtn);
      firstButton.addEventListener(MouseEvent.MOUSE_OUT, outBtn);
      //trace(event.target.name);
      
      
      function overBtn(event:MouseEvent):void {
         firstButton.gotoAndPlay("btnOver");
      }
      
      function outBtn(event:MouseEvent):void {
         firstButton.gotoAndPlay("btnRest");
      }
   }
   
   
                              
}

function buildButtons() {
   
}

function loadVideoPlayer(event:MouseEvent):void
{
   imageLoader = new Loader();
   imageLoader.load(new URLRequest(event.target.name));
   imageLoader.x = 200;
   imageLoader.y = 25;
   addChild(imageLoader);
   imageText.x = imageLoader.x;
   imageText.y = 351;
   for(var j:int = 0; j < xmlList.length(); j++)
   {
      if(xmlList[j].attribute("source") == event.target.name)
      {
         imageText.text = xmlList[j];
      }
   }
}
imageText.autoSize = TextFieldAutoSize.LEFT;
addChild(imageText);

Attachmovie With An Independent Timeline?
Hi,

I'm trying to create a photo galley using attachmovie to generate the thumnails. The thumbnail movies show up fine but apear to be operating in the root timeline instead of it's own. Because of this the rollovers on the thumb clips don't work (i.e. the root timeline is only 2 frames long so the rollover only plays for 2 frames). Here's my code, am I going about this the right way?


Code:


for(var i=0;i<imageArray.length;i++){
_root.attachMovie("thumb","thumb"+i,100+i);
_root["thumb"+i].img.loadMovie("tmb_blur1.jpg");
_root["thumb"+i]._x = layout_array[i].x;
_root["thumb"+i]._y = layout_array[i].y;
}



Any help would be great, thanks

How Do I Make Sound Objects Independent?
I have 3 sound objects playing simultaneously (drums, bass, and synth) and I want three buttons to mute each one individually, yet when I do a sound1.setVolume(0)to one of them it applies the setVolume method to all three. Is the setVolume method only global?

John
(AKA Bingo the Clown)
http://mechasonic.com

Copyright © 2005-08 www.BigResource.com, All rights reserved