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




Implementing A Timer



The code below is used to manipulate some graphics.


MaxScore = 478-(Total_Score*14);
CurrentScore = getProperty("_root.ScoreBox", _y);

while (CurrentScore > MaxScore) {
CurrentScore=(CurrentScore-1);
setProperty("_root.ScoreBox", _y, CurrentScore);
}


This works properly, but it all happens too fast. SO I want to slow it down, I guess by using a timer to effectively achieve the following:


MaxScore = 478-(Total_Score*14);
CurrentScore = getProperty("_root.ScoreBox", _y);

while (CurrentScore > MaxScore) {
CurrentScore=(CurrentScore-1);
setProperty("_root.ScoreBox", _y, CurrentScore);
"pause for 20 milliseconds"
}


How is it best to go about this?



FlashKit > Flash Help > Flash ActionScript
Posted on: 06-09-2006, 11:34 PM


View Complete Forum Thread with Replies

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

MVC: Anyone Actually Implementing It?
Do any of you actaully implement the MVC pattern to build sites? I'm intersted in how one goes about it.
I don't need concrete code examples, but more how you went about separating the layers of the pattern.
Thanks.

Implementing
helle there,

I have a swatch of little lines that each have their specific position and I need them to avoid the mouse head when it passes through, then come back to their original position. (and be repeated over a whole page, creategrid or something?)

I found the following code, but having avoided AS for as long as i could, i have no idea how to implement it ...

http://www.senocular.com/pub/flash/ParticleBehavior.as
http://www.senocular.com/pub/flash/P...avior_doc.html

Could someone have a look or otherwise have the grandeur of giving an idea on how to acheieve this???

Thnk you!

Implementing Screensaver
I have a presentation file called presenation.swf which i converted into presenation.exe . i have another file called screensaver.swf .

what i want is when the presentation is in use and the mouse is not used for say 1 minute then the screensaver file should start playing and when the mouse is moved it should come back to the presentation(like a windows screensaver).

what code should i use in the presentation flash file.

SEO And Implementing Detection
i am using the detection kit from adobe and i am just about to rename the detection script "index.html" which then takes you to the "site.html" file if
everything is cool. my question is am i messing with the search engines
by pushing the site down one level ? should i put all the meta-stuff on the
detection page which is now named "index.html"?

[F8] Implementing Proximity
I'm trying to get some movie clips to duplicate from a single point on the stage and with each iteration I want them to move further away from the start point. This way thay can cover the whole stage and unmask the entire image below.

I sort of have it working with this code, however I think I have some of the math wrong or something because they duplicated movieClips never cover the entire stage. Can anyone poini out my error in the code below?


Code:
var intervalId:Number;
var duration:Number = 50;
var prox:Number = 5;
var control = prox;
var count:Number = 1;
var maxCount:Number = 17;
var startX:Number = 400;
var startY:Number = 200;
var xMin:Number = 0-startX;
var xMax:Number = 500;
var yMin:Number = 0-startY;
var yMax:Number = 280;

function executeMasking():Void {
_root.mcMask.mcItem._x = startX;
_root.mcMask.mcItem._y = startY;
for (i=1; i<=count; i++){
n = i*count;
randomX = (Math.round(Math.random()*(xMax-xMin)/prox))+(startX/2);
randomY = (Math.round(Math.random()*(yMax-yMin)/prox))+(startY/2);
orgClip = "mcMask.mcItem";
dupClip = "mcMask.mcItem"+n;
clipDepth = mcMask.getNextHighestDepth();
mcMask.mcItem.duplicateMovieClip(dupClip, clipDepth,{_y:randomY, _x:randomX});
}
if(count >= maxCount) {
clearInterval(intervalId);
trace("cleared");
}
if(control>count){
prox--;
}
count++;
}

intervalId = setInterval(this, "executeMasking", duration);

[F8] Implementing A Class
I'm teaching myself to write some basic AS2 classes. I hope my question won't seem too naive... Here goes:

I've written a decent little movement class called "slider".
The slider class extends movie clips and has a method called "startMovement".

My question is, is there any way to apply the startMovement method to to movie clip instances without using symbol linkage in the library?

If I use symbol linkage and export for AS and associate each clip with my class, it works fine. But what if I want to apply the method to dynamically created clips?
Or else, what if i want to apply the method on lots and lots of instances? Is there a way to write my code in the FLA or in the AS file so that it applies to any and all movie clips?

Thanks!

Help Implementing A Function
Hi I need to make a function which tests if some conditions are met, and if they are, some code that you write when calling it will be executed. For example: (when the function is called it should look like this)


Code:
myFunction (x) {
//code here
}
Any help will be appreciated.

Thanks

Implementing Interface
I apologize in advance for the newbie question. Is it possible to have my flash file implement a top level interface. I am trying to create component in flash and I would like to define an interface which it will implement but i'm not sure where I would even add in the implement statement in flash.

Implementing Speech
Hi All,

I have developed an application in flash which will retrieve some text from database and ill display it in a text box. As the same i want to make an image to speak the text which is coming from database. Please help me in this regards

Advance Thanks

Hariharan.S

Implementing .swf File Through Css
I was wondering how can I implement a Flash movie through a CSS file? I'm doing a friend a favour with his site, but the person who original made the site for him did it mostly through CSS and Divs. I'm lost, confused and not too familiar with this, can someone help me

Here's the coding from the CSS file:
#header-wrapper #header {
width: 698px;
height: 68px;
background: url(images/home/header.gif) no-repeat top left;
padding: 0;
margin: 0;
text-indent: -1000px;
}

Thank you in advance

Implementing Javascript
Hello. I have a flash site I am currently working on and I got stumped what to do on my portfolio page. I would really like to take this script into flash but I am a bit clueless how to.

Click the thumbnails under Demo 2-
http://www.dynamicdrive.com/dynamici...box2/index.htm

Implementing Speech
Hi All,

I have developed an application in flash which will retrieve some text from database and ill display it in a text box. As the same i want to make an image to speak the text which is coming from database. Please help me in this regards

Advance Thanks

Hariharan.S

Designing Before Implementing
I've made a key notice when it comes to website design, whether it be HTML or Flash. It seems that the sites that are not Run of the Mill, utlize a look that makes the site look like it's a GUI rather than flat colors.

They use shading, beveling, lighting, etc that you might find in a 3D application rather than offhand with a 2D Art program.

So my question is, "How many of you utilize 3D applications like Lightwave, Maya, 3D Studio Max, etc. in order to create the metallic surfaces, proper realistic lighting and other real-world effects for your website GUI?

Or is the average action here to actually build those realistic designs via multiple layers, trial and error with programs like Photoshop?

Implementing The PQueue
Referring to OOPw/AS Chapter 15:

The text suggests using the pQueue as a smart preloader but doesn't flesh out the code that connects the included code to any actaully loading of movies. My learning curve is just a rung or two short of connecting all the necessary dots and i'm hoping for a boost or two from you folk.

My 'big picture' need is to load a number of swf into a duplicated clip. Number of clips involved is usually less than ten, a dozen on the outside, ranging in size from 20k to 150k ... usually around 70k.

My current preloader is just brute force....one at a time...when this loaded-load the next. The master movie uses only one of these clips at a time and 80% of the time they are needed in the same order as they are loaded so I may not have a real acute need to a priority loader at all...but it'd be nice to figure this thing out.

If I understand this thing, the qQueue would give me the means to interupt one movie's loading if my master movie recieved the given event. If yes, could I see some psudo-code of how one stops a loadMovie in the middle of loading?

Also, is bandwidth most efficently used loading only one movie at a time or are there advantages to running 3 or so concurrent loads?

thankx
--steve...

Implementing CAPTCHA In AS3
I've been playing with a simple PHP captcha example - just 2 PHP files:

1) RandomImage.php generates a random string, stores the MD5 hash of that in a session variable then serves up the generated image.
2) Submit.php receives a $_POST var string from a form and compares the MD5 hash of that, with the session variable stored previously. If successful it sends an email or whatever, otherwise it does nothing.

My problem is now how I can implement that in flash. I can use a Loader to grab the RandomImage.php and display that, but unlike running it in a browser it has no effect on the session variables (I've checked).

I'm thinking the answer must lie in AMFPHP remoting somehow but I'm struggling to work out a method that is doable but still secure. I could run a script that moves the session var into a variable that I can retrieve in flash but doesn't that defeat the purpose?

Any suggestions or tips would be well received!

Implementing Flash From Javascript
Here are the facts:
1) I have a simple MC animation inside my flash movie.
2) There is nothing else in the flash movie
3) I will have multiple instances of this movie in my page
4) I want to play the MC using an external HTML button's onClick event to see the animation play.

However, this is also of interest to me:

1) Take the HTML button and place its likeness inside the movie
2) Call my external user-define Javascript function

That may be even more efficient.

How is this done?

Thank you in advance for your thoughts

Implementing Sound Loop A
I have a 2 steps remaining for completion of my site.

the first is a background loop.
I followed a tut that assisted me in building a one text ON/OFF button, however-the track only functions if the user progresses through the timeline in order (I have 12+ goto and stop frames with as many that reverse the choice once there)
So if the user wants to re-review or backup, the music stops.

Whats the best way to deal with this or make it flow through and still have basic on off abilities?

2) I have a pictoral tour of reptile hunting in CostaRica- it contains 100 images that fade in and out as the timeline progresses. I wish to make this play on the main window without affecting the main timeline. It has to align to the page as well (but i don't want to do it frame by frame).
I have tried to place it in as a seperate movie symbol of the main timeline but it wouldnt play when instructed to jump to that frame of the main timeline. and it was not aligned properly.

How do i align it? What order of actions might you suggest i try using? or is there an alternate way that is better?

Thanks for the assistance! Im actually beginning to grasp the basics.

Implementing Text Animations
I downloaded a Text template off of this site that does some fancy stuff and I attempt to implement it and it does the movements but not correctly, the words are too clogged during operation to read. Dunno how to explain it but maybe someone knows what im talking about. Please help im a major newby.

Thanks
Joel
[Edited by tuffy240 on 08-04-2002 at 11:46 PM]

Implementing Pause To Whole Movie
I'm thinking about implementing the pause to the _root. What i meant that i want to pause though a botton that stop the _root and all the movie palying on root and all the submovies playing on the movies on root. I guess for this i have to access all the movie from root. Now thats easy when i got all the instant manes but what if i don't know them ???

so here is my question ... is there any way to access the unknown childs of a movie and childs of the child and so on ? maby there is an array for a movie clip that holds the childs instant names ( or atleast _lovels ). Is there ???

anyone help please ???

Implementing Callback Functionality
Hi, everybody.

Wondering if anybody here has programmed callback functionality. I need to know for example, if a movieclip has finished whats it's doing. Using frames is not what i'm looking for.

kinda like this:

MC_1.sayHello = function( callbackMovieClip, callbackFunc ){
callbackMovieClip.callbackFunc("john");
}


MC_2.whatsYourName = function(name){
trace("Hello "+name);
}


MC_1.sayHello( MC_2, MC_2.whatsYouName);

Implementing Classes (Very Simple & Brief)
I'm trying to get up to speed on using classes. I built a super simple one, but the linked .fla says that it can't load the class ('Box').
Basically, I don't know how to properly import a class. Would someone mind taking a look at this file and showing me?
Thanks

Implementing Javascript In ActionScript
Can someone help me use this Javascript code in Flash? I want it to execute when the user clicks on a button.
I need to define the function 'addBookmark' :


Code:
function addBookmark(title,url) {
if (window.sidebar) {
window.sidebar.addPanel(title, url,"");
} else if( document.all ) {
window.external.AddFavorite( url, title);
} else if( window.opera && window.print ) {
return true;
}
}


and then call it when someone clicks on a button:

Code:
void(addBookmark('Window Title', window.location.href));


If there is a way to do the exact same thing but with ActionScript, please let me know.

Implementing A Sound Into My Movie...
Hi, first, great site you have here, just registered

I'm currently making a little movie clip in flash, and I want to put in a song off my PC, I can get the song into the movie and it plays no troubles.

What I want to change is the start, i want to start the song at 3:40 into the song, how do I do this?

Instead of it starting at the start, it starts at 3:40 minutes. I hope you understand my questions.

Thanks in advance

[CS3] Implementing Preloader For XML Gallery
Hi, having a slight issue trying to implement a MovieClipLoader for my xml image gallery. The code for the gallery works fine, but trying insert the below code for the preloader has got me scratching my noggin. Nothing dramatic mind you, but right now tracing any of these returns no results. Can anyone give me some insight? Thanks.


PHP Code:




var loaderMC:MovieClip = new MovieClip();
var mclLoader:MovieClipLoader = new MovieClipLoader();
var mclObj:Object = new Object();

mclLoader.addListener(mclObj);
mclObj.onLoadStart = function(targetMC) {
    imgContainer._visible = false;
    nBar._visible = false;
};

mclObj.onLoadProgress = function(target, loaded, total) {
    nBar._width = Math.round((loaded/total) * 100);
}
    
mclObj.onLoadComplete = function() {
    imgContainer._visible = true;
    nBar._visible = false;
    trace("Load Complete");
}

Implementing Classes In Flash
Quick History:
I'm a php, vb6, C# developer who has been working with flash since MX AS1. I always did my coding procedurally when working in flash but OOP for PHP, VB, C# so I do understand classes and general OOP fundamentals. Now I have moved over to Flash OOP and it has been a real headache getting any of this to work.

The problems I have been having is not so much related to the classes themselves but rather implementing them inside flash. I finally have a couple of working models I created and they have lead me to some conclusions as to what works and what does not. Some or all of these conclusions could be false so I'm posting them here as a way to help others and hopefully get a fresh prospective on the matter.

My Conclusions (Are they Right?):

1) All classes must come from an external .AS file

2) If you are going to use any classes there MUST be a "Document Class" listed. (I can seem to get any object to work until I have set up my Document Class class even if its only an empty class it has to be there).

3) The document class has to be named "Main". NOTE: This might only be true if the package is unnamed and I am not using a fully quallified name com.mysite.myclass. (I'm REALLY not sure if this is true... but for some reason when I change the name of the class and the name of the file to something like "Class_test" and rename the file to Class_test.as and point the document class to the Class_test class it does not work.)

Well thats it. Any feedback would be great.

Thanks,
Mike

Implementing Motion Graphics
Hey peeps, in After Effects and in Apple Motion, whats the best way of getting my motion graphics into flash?

Implementing Internet Radio
Hey !

I'm still very new to flash and really don't know much about actionscript or anything - I just wanted to know if anyone could tell me how I could link to a streaming internet radio station in the background of my website. I'd really appreciate your help. The Station can be played in three different formats as you can see here: http://www.hbr1.com/

I'd really appreciate your help. Thanks a lot!

(my website is www.astralelements.com)

Implementing A Control Bar In A Movie
Hi everybody,

I have a basic question.
In order to use a control bar, of the kind that you can use to rewind, play, pause, stop, and fast forward the movie...Do I have to create the animation of the movie based on the timeline and its frames, or is there a way to control the animation of my movie, even when it is created with actionscript?

Please let me know your opinion,
Thanks a lot

Implementing Different Program States
Hi guys,

I made a simple solitaire game; I set my document in CS3 to Main.as and did everything in there. Now I want to add to it by doing something like this:

startup: show loading screen while the image files load, then...
menu: game menu with a start button that goes to...
game: the game itself (what I made so far) with a quit button that goes back to the menu

I really have no idea how to do that. The states would have to have access to each other; for example, I'd have to be able to access the graphics loaded during 'startup' from the 'menu' and 'game'. I'd like to have an .as class/file for each state so I can re-use them in other games, if possible.

Any help getting me started would be appreciated, tutorial links would be better.

Thank you.

[F8][OOP] Implementing Game Menu
Hi!

It's more of an AS question, that's why I didn't put it into games category. I've got a game, it's mostly OOP. I've only one frame with "include" statement and the rest is in classes. Now I'd like to do a menu. It's my first flash game so I'm quite confused.

Can I somehow separate the code of buttons inside menu? I add new frame with a menu MC inside and the "stop()" code. The "start game" button has got this code inside:


Code:
on(release)
{
_root.gotoAndPlay("2");
}
In frame 2 there's a playable part of my game. It works but... Can I move this code somewhere else so I can manage all buttons in one place? I tried:


Code:
_root.menu.start_button.on(release)
But it's not working (as if it should...). It was just a blind guess. Anyone?

An Efficient Way Of Implementing Buttons
Hello I am trying to make this interface as shown in the attached picture.

Is there any efficient way of implementing this. If you need more details about this plz let me know.

Problem Implementing Preloader
Hey Kirupa!
I'm kinda green in flash and have a problem implementing another preloeader in my basic structure. Can anyone help me out here? Thanks!
I added the basis and the preloader I'd like in it.

Cheers!


http://users.telenet.be/willemdepuydt/brands.fla
http://users.telenet.be/willemdepuydt/circles_mx04blackwhite.fla

Implementing Motion Graphics
Hey peeps, in After Effects and in Apple Motion, whats the best way of getting my motion graphics into flash?

Implementing Internet Radio
Hey !

I'm still very new to flash and really don't know much about actionscript or anything - I just wanted to know if anyone could tell me how I could link to a streaming internet radio station in the background of my website. I'd really appreciate your help. The Station can be played in three different formats as you can see here: http://www.hbr1.com/

I'd really appreciate your help. Thanks a lot!

(my website is www.astralelements.com)

Implementing KeyBoard Navigation
How important is website keyboard navigation?
Recently I started to implement keyboard navigation to all websites I develop.
Example: http://www.angelikigiakoumi.com/
Is keyboard navigation important to you?
Does a user try to navigate to full flash websites with keyboard?

Implementing Flash Intro Into HTML
I have a flash intro for my site, but i can't get it right in HTML....i use dreamweaver MX to make the site, but i can't get the movie to fill the screen....is there a way to make it fit the screen no matter what resolution the viewers of the page have set their screens to? i've tried to just keep it small but that means it never plays in the middle =(
Please help.....i want it to play full screen or in exact middle but i can't do it =(

Implementing An External HTML File...
I am trying to have when you click on a button within the flash movie, a window pops up inside that is scrollable and has an HTML file in it. It is a way for me to update the site without having to edit the movie, just edit the HTML file that it will involve. If someone could help me or point me to a tutorial, I'd appreicate it, thanks.

Implementing A Delay Or Pause Before Certain Events
Dear people,

I'm in the process of making this little wordgame:
A crate with a word on it appears on screen, then the user selects whether they think it's spelled correctly or not.
When the time's up, all the crates are stacked up in piles of correct or not (whatever the user selected, not actual correctness). Each crate then receives a tick or a cross, depending on whether the user was correct or not.
This is all working nicely, however I would like the ticks and crosses to appear one by one. Currently they all just appear instantly.
This is the code I've got for the crates being stacked up, and the relevant ticks and crosses appearing:


Code:

for (var m:Number = 0; m<Rcounter; m++) {
this.attachMovie("crate", "crate"+m, m);
this.attachMovie("tick_mc", "tick_mc"+m, m+50);
this.attachMovie("cross_mc", "cross_mc"+m, m+150);
StackHeight = 330;
this["crate"+m]._height = StackHeight/5;
this["crate"+m]._width = this["crate"+m]._height*1.85;
//y positions
this["crate"+0]._y = 400-(this["crate"+0]._height/2);
this["crate"+m]._y = this["crate"+m-1]._y-50;
//this["crate"+m]._height
crate1._y = crate0._y-crate1._height;
crate2._y = crate1._y-crate2._height;
crate3._y = crate2._y-crate3._height;
crate4._y = crate3._y-crate4._height;
crate5._y = crate0._y;
crate6._y = crate0._y-crate1._height;
crate7._y = crate1._y-crate2._height;
crate8._y = crate2._y-crate3._height;
crate9._y = crate3._y-crate4._height;
crate0._x = (crate0._width/2)+5;
crate1._x = (crate1._width/2)+12;
crate2._x = (crate2._width/2)+3;
crate3._x = (crate3._width/2)+15;
crate4._x = (crate4._width/2)+7;
crate5._x = crate0._x+crate0._width+5;
crate6._x = crate1._x+crate0._width+5;
crate7._x = crate2._x+crate0._width+5;
crate8._x = crate3._x+crate0._width+5;
crate9._x = crate4._x+crate0._width+5;
//give Rcrates Rlabels
this["crate"+m].content_txt.text = Rstack_array[m];
//ticks and crosses positioned on the crates
this["tick_mc"+m]._x = this["cross_mc"+m]._x=this["crate"+m]._x;
this["tick_mc"+m]._y = this["cross_mc"+m]._y=this["crate"+m]._y;
//make invisible
this["tick_mc"+m]._visible = false;
this["cross_mc"+m]._visible = false;
//make relevant one visible
if (Rtick_array[m] == true) {
this["tick_mc"+m]._visible = true;
} else if (Rtick_array[m] == false) {
this["cross_mc"+m]._visible = true;
}
}
So to summarise:
How do I implement a pause of certain length (say 1 second), before each tick or cross is displayed?

Many thanks in advance!

And for the bonus question: how do you make your code appear in pretty colours in this forum?

Trouble Implementing A Hit Test Object
Hi,

OK, Im trying to build an accordian-type menu from scratch.

I have a main class, a menu item class, and on each menu button is a movieclip of a "tab".

Im most of the way there, just trying to get each menu item to stop when it hits a tab of another menu button.

Im trying to use hitTestObject, but getting errors. Essentially Im having trouble talking with the tabs of the individual menu items- i think this is perhaps because i created the menu items from an array in the constructor function and can't access them now...

Im essentially looking for the code that will say "stop moving when you hit any other tab on the stage". Here is the code when I create the menu items and also where Im having trouble.

Thanks for any ideas...


ActionScript Code:
package
{
    import blah blah blah
   
    public class Accordian extends Sprite
    {
       
        public var a:Array = new Array;
        public var menuNum:uint = 5;
        public var tabWidth:int = 22;
        public var tabX:int = 0;
       
        public function Accordian()
        {
            for (var i:uint = 0; i < menuNum; i++)
                {
                a[i] = new MenuItem;
                a[i].x = tabX;
                addChild(a[i]);
                a[i].addEventListener(MouseEvent.MOUSE_DOWN, checkLoc);
                tabX += tabWidth;
                }      
        }   

// trouble code - how do i talk to the menu tabs (a child of MenuItem)?  
       
        private function moveRight(clicked:Event):void
        {
            var movingBtn = clicked.target;
            movingBtn.x += 10;
           
            if ( movingBtn.x >= stage.stageWidth - tabWidth || movingBtn.hitTestObject(MenuItem.tabby))
            {
                movingBtn.removeEventListener(Event.ENTER_FRAME, moveRight);
            }
        }
       
   
}

Implementing Music - Loading Problems
Ok this is my "first" help me out post - since I've been on this site for a little while and I've searched the forums and tutorials... So here goes...

I was working on a "simple" flash banner - that displays my text and image. Its about 5kb. I even have a preloader for it...and it all works pretty nice and stuff.

My problem is that I decided I wanted to add sound to this banner with a play and stop button. I wanted to play an mp3 that I had created - which is just a few seconds over 2 minutes long. Well...on my computer - it works dandy...even though my little banner is now 1300 some kbs heavier. When I go and upload it to my site...the banner never loads. Even the preloader never comes on. [the code et al. to play the music begins after the preloader finishes loading the movie] And I am on broadband connection here.

Is it because my banner is ridiculously too large? I am assuming it is.

I guess my next question is - what is the best way of implementing music [in the future I would like to load more than one mp3] in my .swf movie? I do have a separate .swf file that contains my music buttons and the actionscript code. Is it possible for me to load this .swf file into a movieclip using loadMovie? As of right now however, all my buttons and code for the music all is contained in my flash banner movie.

Anyways - thanks for checking this post out. If anyone can help - I'd appreciate it.

Peace.

Implementing Small Bits Of Flash
A client of mine has downloaded a flash template. He wants the website to be a standard dynamic site instead of flash. Basically, he has used the flash template that he downloaded as a visual guideline for creating his site. He designed most of the site in Photoshop. He only wants me to put in the appropriate coding.

However, he has decided that there are small bits of flash that he would like to have implemented into the site. He simply wants a simple "pulsing star effect" next to the header. This effect was from the template that he downloaded. My problem is that I know very little about flash. Does anyone have any advice as to how I should go about implementing this flash into an .aspx or .html file?

Thanks

Help Implementing Scale/center Code
I'm having trouble implementing it though..







Attach Code

This is the code i want to use

function LoadImage(clip, maxWidth, maxHeight, bordersize, filename) {
clip._alpha = 0;
clip.loadMovie(filename);
onEnterFrame = function() {
if(clip.getBytesLoaded() >= clip.getBytesTotal() && clip.getBytesLoaded() > 4){
// Scale
scaleW = ((maxWidth - (bordersize * 2)) / clip._width);
scaleH = ((maxHeight - (bordersize * 2)) / clip._height);
if (scaleH >= scaleW) { newScale = scaleW; }
else { newScale = scaleH; }
clip._width = clip._width * newScale;
clip._height = clip._height * newScale;
// Center
if (clip._width < maxWidth) { clip._x = (maxWidth/2) - (clip._width/2); }
if (clip._height < maxHeight) { clip._y = (maxHeight/2) - (clip._height/2); }
// Show
clip._alpha = 100;
delete onEnterFrame;
}
};
};




and this is the loadmovie code i'm currently using



function loadGImage(title, bigImgURL)
{
_root.bigImage.imageContainer.loadMovie(bigImgURL, 100);
_root.bigImage.imageContainer._x = 0;
_root.bigImage.imageContainer._y = 0;
_root.title.text = title;
_root.downloadButton.onRelease = function ()
{
getURL(bigImgURL, "_blank");
}
;
}

Implementing Filter Class For Bitmapdata
Hi all. I am trying to experiment with the bitmapdata class for a project I am working on. I need to twirl one image into another. I found this class at: http://code.google.com/p/as3filters/source/browse/trunk/src/as3/Filter.as?r=3

I am just learning about class packages and would appreciate any help on getting these filters to run properly on an image in my flash movie. I don't understand how to specify which image or movieclip gets the filter applied, and how to correctly install this class.

Thanks,

Troubles With Implementing A Flash Movie
Hi all,
This is my first post and hope someone can assist in my troubles. I have created a webpage with DreamweaverMX and have also created a movie in flash. Actually I had help from someone here that has posted a snowfalling tutorial. Anyhow, I have both items and they both work well. I would like the snow to fall overtop of my existing webpage or as the background image. I'm having trouble with both. Can anyone help in pointing me in the right direction?

Thanks for any assistance!

Problem Implementing SetInterval In A Prototype
Hi. I'm trying to write a prototype function that will use setInterval. The following script defines a simple movieclip prototype that traces the clip's x position when called. The function works fine when called explicitly ( _root.foo.trace_x(); ), but does not when called by a loop.

There are three clips on the stage, their instance names are foo, man, and chu. I created an array so I could loop through and have each one run the trace_x function once.

Here's the code:


Code:

clips = Array('foo', 'man', 'chu');
num_clips = clips.length;
//
MovieClip.prototype.trace_x = function() {
trace(this._x);
clearInterval(this.click_timer);
};
//
for (i=0; i<num_clips; i++) {
current_clip = clips[i];
delay = 1000 * (i + 1);
_root[current_clip].trace_x_timer = setInterval(_root[current_clip].trace_x, 1000);
}
The output should be like this:
123.45 (x value of foo clip, traced after 1 second)
854.24 (x value of man clip, traced after 2 seconds)
453.29 (x value of chu clip, traced after 3 seconds)

but instead, the output is "undefined" over and over and over.

An example .fla can be found at http://rgcreative.com/transfer/proto...etinterval.zip

Thanks for any help!

Implementing Flash Menu In Homepage
Hi Guys,

I'm completely new in actionscript and flash so sorry for my stupidiy.
My problems are:
1. The button links in flash menu that i have created is not working when it is embedded to my homepage.
2. I think the actionscript is correct, i have followed some video tutorials in the net. All the button links work when played as a movie or as swf.
What I need is:
"To make the links in flash menu work when it is embedded to my homepage"

Here are the scripts:
In Actionscript:
__________________________________________________ ____________________
on (release) {
//Goto Webpage Behavior
getURL("http://jfcc.cogia.net/home.html","_self");
//End Behavior
}
__________________________________________________ ___________________
(Im using macromedia flash mx 2004 as my flash editor)

__________________________________________________ ___________________
In html:
__________________________________________________ ___________________
<OBJECT classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/s...ersion=5,0,0,0" WIDTH=780 HEIGHT=143> <PARAM NAME=movie VALUE="0099.swf">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE=#ffffff>
<EMBED src="0099.swf" quality=high bgcolor=#ffffff WIDTH=780 HEIGHT=143 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/...ShockwaveFlash">
</EMBED>
</OBJECT>
__________________________________________________ _______________________
I will appreciate any kind of help like giving tutorials, providing working scripts and etc.! Thanks in advance, I really need to finish my website asap.

Troubles With Implementing A Flash Movie
Hi all,
This is my first post and hope someone can assist in my troubles. I have created a webpage with DreamweaverMX and have also created a movie in flash. Actually I had help from someone here that has posted a snowfalling tutorial. Anyhow, I have both items and they both work well. I would like the snow to fall overtop of my existing webpage or as the background image. I'm having trouble with both. Can anyone help in pointing me in the right direction?

Thanks for any assistance!

Problem Implementing SetInterval In A Prototype
Hi. I'm trying to write a prototype function that will use setInterval. The following script defines a simple movieclip prototype that traces the clip's x position when called. The function works fine when called explicitly ( _root.foo.trace_x(); ), but does not when called by a loop.

There are three clips on the stage, their instance names are foo, man, and chu. I created an array so I could loop through and have each one run the trace_x function once.

Here's the code:


Code:

clips = Array('foo', 'man', 'chu');
num_clips = clips.length;
//
MovieClip.prototype.trace_x = function() {
trace(this._x);
clearInterval(this.click_timer);
};
//
for (i=0; i<num_clips; i++) {
current_clip = clips[i];
delay = 1000 * (i + 1);
_root[current_clip].trace_x_timer = setInterval(_root[current_clip].trace_x, 1000);
}
The output should be like this:
123.45 (x value of foo clip, traced after 1 second)
854.24 (x value of man clip, traced after 2 seconds)
453.29 (x value of chu clip, traced after 3 seconds)

but instead, the output is "undefined" over and over and over.

An example .fla can be found at http://rgcreative.com/transfer/proto...etinterval.zip

Thanks for any help!

Problem Implementing SetInterval In A Prototype
Hi. I'm trying to write a prototype function that will use setInterval. The following script defines a simple movieclip prototype that traces the clip's x position when called. The function works fine when called explicitly ( _root.foo.trace_x(); ), but does not when called by a loop.

There are three clips on the stage, their instance names are foo, man, and chu. I created an array so I could loop through and have each one run the trace_x function once.

Here's the code:


Code:


clips = Array('foo', 'man', 'chu');
num_clips = clips.length;
//
MovieClip.prototype.trace_x = function() {
trace(this._x);
clearInterval(this.click_timer);
};
//
for (i=0; i<num_clips; i++) {
current_clip = clips[i];
delay = 1000 * (i + 1);
_root[current_clip].trace_x_timer = setInterval(_root[current_clip].trace_x, 1000);
}



The output should be like this:
123.45 (x value of foo clip, traced after 1 second)
854.24 (x value of man clip, traced after 2 seconds)
453.29 (x value of chu clip, traced after 3 seconds)

but instead, the output is "undefined" over and over and over.

An example .fla can be found at http://rgcreative.com/transfer/prototype_and_setinterval.zip

Thanks for any help!

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