SetInterval Dynamicly?
Hi,
I wonder if it's possible to make the interval value in setInterval dynamic? The code I'm working with (below) doesn't update the interval value. Is there a way to do this? I want the interval to 'slow down' when it's called more often.
timer = 300; // // FUNCTIE
k = 0; function maak_gezicht() {
pos = new_jpgs[k].toString();
punt = pos.indexOf(".");
pos = pos.substr(0,punt); // maak array pos = pos.split("-");
pos_x = Number(pos[0]); pos_y = Number(pos[1]);
_root["holder"+k]._x = pos_x; _root["holder"+k]._y = pos_y; k++; timer--; }
// timer setInterval(maak_gezicht,timer); stop();
Thank you very much in advance for your help. Regards, Danielle.
FlashKit > Flash Help > Flash MX
Posted on: 11-13-2002, 04:10 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Loading A Swf Dynamicly Which Also Loads A Swf Dynamicly ?
ok; here is the situation;
i have three movies
first one is A
second B
and the third C
B loads C dynamically when pressed a button in it
A loads B dynamically when pressed a button in it
here is the problem;
I open A and pressed the button to load B dynamically, everthing is ok, B is loaded...
But then when i press the button (on dynamically loaded B) to load C, nothing happens?
isn't it possible in flash mx to load something dynamically, from a movie which is loaded also dynamically?
sorry for my awful english & thanks for replies...
Loading A Swf Dynamicly Which Also Loads A Swf Dynamicly ?
ok; here is the situation;
i have three movies
first one is A
second B
and the third C
B loads C dynamically when pressed a button in it
A loads B dynamically when pressed a button in it
here is the problem;
I open A and pressed the button to load B dynamically, everthing is ok, B is loaded...
But then when i press the button (on dynamically loaded B) to load C, nothing happens?
isn't it possible in flash mx to load something dynamically, from a movie which is loaded also dynamically?
sorry for my awful english & thanks for replies...
Custom Objects And Internal SetInterval Loops -> A Problem Stopping The SetInterval
Let's say I had a class like this:
PHP Code:
var someVar = new Widget();
function Widget() {
// Some variables, etc...
this.int_someCommand = 0;
// Activate the function on instantiation
this.someCommand();
};
Widget.prototype.someCommand = function() {
clearInterval(this.int_someCommand);
this.int_someCommand = setInterval(this, 'someCommandLoop', 50);
};
Widget.prototype.someCommandLoop = function() {
trace("THIS IS A WIDGET LOOP!");
};
...now, I was always under the impression that if you delete an object in Flash, the setInterval loops associated with it would die as well. But when I try to:
PHP Code:
// At some other point in my timeline...
delete someVar;
or:
PHP Code:
someVar = new Object();
...the original loop is still running (I can tell just by reading the trace). How do I go about properly terminating a setInterval loop inside an Object without having to call a clearInterval()? Or is a clearInterval() the only way?
Thanks.
Tween Class, Does It Use Setinterval? Getting Strange Setinterval Type Problem
I have a gallery with small thumbnails. Upon clicking a thumbnail, I am using the Tween class to pull clips from an array and fade them between each other, loading the clips into a container.
When I click the thumbnail it loads the .swf fine and plays the Tween Class animation just as it's supposed to, however if I click any other thumbnail and go back to that first one the timing gets totally screwed up and the fades get jittery and overlap each other, much like it does with setInterval if you don't clear the intervals.
Is there a way to clear the Tween Class? Does it's timer run on setInterval?
This is the code I am using for the tween class
Thanks!
Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
//content movieclips put into an array
var mcArray:Array = new Array(content1, content2);
for (var k in mcArray) {
mcArray[k]._alpha = 0;
}
// tween class has something called "OnEnterFrameBeacon" and it is added to the stage
// when we import the as file, so I wanted to get rid of it.
var n:Number = 0;
function playFades() {
if (n<mcArray.length) {
var tween_handler1:Object = new Tween(mcArray[n], "_alpha", Strong.easeIn, 0, 100, 1, true);
tween_handler1.onMotionFinished = function() {
//trace("motion finished by "+mcArray[n]);
//n++;
var tween_handler2:Object = new Tween(mcArray[n], "_alpha", Strong.easeIn, 100, 0, 3.5, true);
tween_handler2.onMotionFinished = function() {
//trace("motion finished by "+mcArray[n]);
n++;
playFades();
};
};
} else {
n = 0;
playFades();
}
}
playFades();
Dynamicly Stopping MCs
I need to know how to stop a movie clip thats nested, and numbered dynamically. (ex. rung.rung1.stop(); rung.rung2.stop()
If you need more information, see below.
Information:
I have a movie clip (ladder), that uses:
Code:
duplicateMovieClip(rung1,"rung"+numRungs,numRungs);
in the parent of that very same movie clip, I have the lines:
Code:
if (ladder.numRungs == 32) {
for (x=1; x<33; x++) {
ladder.eval("rung"+x).rung.stop();
}
ladder.numRungs++;
}
The important part is:
ladder.eval("rung"+x).rung.stop();
I guess thats not legal, because it doesn't stop any thing at all. If I use:
lader.rung1.rung.stop();
it works fine..............
What do you do to dynamically stop MCs
Loading JPG Dynamicly
Can I load JPG files dynamicly? I tried to use LoadMovie, but it doesn't seem to work....
Loading Gif Dynamicly
i can load dynamicly non-progressive jpg, but i can t load gif in the same way ... (with the loadMovie command)
witch gif format can i use for loading my image ??
thanks .
Loading MOV Dynamicly
I would like to load MOV files into flash. The links to the MOV files are set in an XML file. Does anybody have an idea to let these movies play in flash by using some sort of player in flash? It has to be possible to add movies in the XMl fiel. so you can't use File-> import. So the idea is that I have a variable with the moviename. and flash has to play the link of this varioable.
Any Ideas?
Thx
Diederik
Dynamicly Load Txt
hi there
i have a question about loading some txt img files
i receive some data from a mysql database.
I want to post the description with comes with the received data to some neat font.
is there a possibility for flash to link each letter to a letter outine or is there a option of automating this process and let flash create outlines in the font i want to use?
can anyone help me?
thanks
Scaling MC Dynamicly
i need AS code that allow onRelease a MC to scale up from x size at x speed (millisecond ??? frame rate ??? )
i also need that couple other MC (picked randonely into a bank of MC ) scale up or down from x size at x speed fallowing the initial MC
if anyone have code or link it would be appreciated
How Should I Get The Name Of An Array Dynamicly
Hi all,
I got a couple of arrays holding data base on language
Code:
tellBox_lang_EN = ["asf,asf, ad"];
tellBox_lang_DE = ["blah, blah"];
Now based on var lang I want to use the right array.
code so far
Code:
content = ["tellBox_lang_"]+lang;
and then use content[0] content[1] etc.
But the naming isn't right. How should I get the name of an array dynamicly?
Grtz
How To Target An XML Dynamicly?
PHP Code:
private var myXML:XML = <companies> <company name="Sun Inc."> <department name="Accounting"> <employee name="Paul"/> <employee name="Jill"/> </department> <department name="Development"> <employee name="Ann"/> <employee name="Peter"/> </department> </company> <company name="Moon Inc."> <department name="Accounting"> <employee name="Bill"/> <employee name="Sam"/> </department> <department name="Development"> <employee name="Jenny"/> <employee name="John"/> </department> </company> </companies>;private var myNewXML:XML;private function init():void { myNewXML = myXML.copy(); delete myNewXML.company.department.employee; getContent(myNewXML.company[1].department[1]);}private function getContent(xml:XML):void { //get xml employees from myXML based on the xmlobject i get}
Based on the position in myNewXML, how do I dynamicly get the content in the original myXML (I want to extract the employees from the myXML)?
I know I can get the position with xml.childIndex() and traverse through parents with xml.parent() but I dont know how I would write the syntax to actually target the original myXML.
(This code is simplified and cut down from a larger context, it may seem abit pointless in this context)
Dynamicly Name Mc Instances
So the problem is this:
I want to place 24 instances of the same movie clip on stage in a grid 6 by 4.
I'm doing that using a loop:
Code:
for (var i:uint=1 ; i<=24 ; i++){
for (var x:uint=0 ; x <6 ; x++ ){
for (var y:uint=0 ; y<4 ; y++){
var c:Tile = new Tile();
c.stop();
c.x = x*63;
c.y = y*63;
var r:uint = Math.floor(Math.random()*24);
addChild(c);
What i would like to achieve is give a name to eveny next instance (Tile1, Tile2, Tile3)so i could have one of 24 tiles differ from other (go to frame 2 f.ex.).
No idea how to do that. Please help...
Help Resizing .swf Dynamicly
Hi All
in my site i'm using an 'htm' page with 2 frames : _left and _right.
in the right frame an asp page that loads with a ew movie, every time a link is pressed in the left frame.
the probleme is that i want to make the asp page changes the width and height of the loader object and make it fit the loaded movie.
i want to do that without having to store width&height of every movie in seperate external file.
THANX a lot
u can visit the page to know exactly what i'm talking about
http://www40.brinkster.com/hmdgraphi...jectframes.htm
Sound Dynamicly
hey guys ... can anyone direct me to a tutorial of fla sample file i need to load a sound dynamicly w/c will i used it for my rollover fx and when i roll over on the button this sound will play
Resize Dynamicly
how can i hoder, when load the other oject, go resize the hoder in horizontal first then vertical just like evb
then load the jpg or swf to the holder.
thanks
Dynamicly Renaming Variables
I have a bunch of buttons loaded. I want to input names from a text file into a dynamic textbox inside of a dynamicly loaded mc. So far i have all my variables named in my text file, but i need flash to rename them automaticly.
heres what i basicly want to do
heres what i have now:
_root.menu1.type = text1
_root.menu2.type = text2
_Root.menu3.type = text3
etc....
text1,2,3 are varibles loaded from my text file. I have code to duplicate the menu name. type is the variable i want put the text2,2,3 into with every new loaded mc.
for (i = 0; i <=numMenus; i++) {
set ("_root.menu"+i+".type",);
}
i tried using same code for menu1,2,3 but it doesnt seem to work. I need some help. Any Ideas?
Change Color Dynamicly
Im desiging a nav for one of our web tools taht will be reused on many sites. we have color info for each of the sites in a db. what property do i need to set to change the color. i dont see anything under setProperty.
I'm assuming i should make each of them a MC
thanks
Dynamicly Updating Site
hi out there
How do go about seting up and admi area
so that the client can update there site.
I know you can use the FS command to
save txt file out of flash but how do you
make sure all ther variables are Ok.
I have seen someone mention this. I have
looked every where to find example but
I have had on luck.
hope you can help
Can Anyone Help Me Let My Dynamicly Loaded Buttons Go Away
hi ppl.
i have a movie that loads a menu based upon a XML file.. Writers(as main menu) - Publications(as sub menu).. this movie is loaded into another so the havy actionscripting will not me loaded untill necessary .. when i unload the menu movie the buttons stay on the main clip... thats just what i don't need.....
Thanx
Can You Create Text Dynamicly ?
Is there a way in action script to create a field that displays, say a date, depending on what the user does. All in actionscript...without (or very little) use of multiple objects.
For example:
User clicks buttonA. field displays 1925.
User clicks buttonB. same field displays 1950.
and so on...
The help is MUCHO appreciated ! Thanks in advance!
Setting Variables Dynamicly In MX
In flash 5.0 the following syntax was accepted for setting the variables x1, x2 up to say x30
to "nn1", "nn2,....."nn30", respectivly:
for(i=1;i<31;i++)
{
eval("x"+i)="nn"+i
}
This would assign x1 to "nn1" and so on.
But in MX you are not allowed to use eval on the left side of "="
How is this "problem" solved here?
SetMask() With Dynamicly Loaded JPG
Hey I am loading a .jpg into an empty movie clip called "holder" and trying to set a movie clip as a mask called "mask". hummm
holder.setMask(mask)
loadMovie("myPhoto.JPG","holder")
Thanks
Using Dynamicly Loaded Font
I want to embed dynamic loaded font ...(to use it in a ScroolPane)
For that, I built:
- A simple movie called "test.fla" which loads and uses an embed font.
- .. And an other movie "testuser02.fla" which load "test.swf" ...
"test.swf" Loading works ... but "test.swf" text doesn t appear !
.. don t know why !!
WHY ?? WHY ???
Tell me how can i do ???
Trouble With Dynamicly Loaded MP3's
So im making a jukebox and have been following the tutorials on www.kennybellew.com and it has been great help but im still having trouble when I click on a different song i can't seem to get the others to stop playing. I just have buttons with the various song names, and they load on press.
help please
PEACE,
Drop
Get Dynamicly The Array Index
how do I get the value of an array dynamicly?
myArray = [];
myArray[0] = "peter";
myArray[1] = "simon";
cnt = 1;
trace(eval("myArray["+cnt+"]"));
output window:
undefined
thanks
Dynamicly Dealing With Functions.
Hi all,
I have the following code that doesn't work. Now I have to copy-past 20 times the function so I'd like to better that part.
This code works but is a little to mutch...
function setKap31 () {
_root.kappen2.kap31Color.setRGB(r << 16 | g << 8 | b);
}
function setKap32 () {
_root.kappen2.kap32Color.setRGB(r << 16 | g << 8 | b);
}
etc.
This I have in mind:
for(tel=30; tel <= 50; tel++)
Eval("function Kap"+tel+" ()");
Eval("_root.kappen.kap"+tel+"Color.setRGB("+r+" << 16 | "+g+" << 8 | "+b+")");
{
A guy sad that I had to use [ ] ..??
If someone cound give me a pointer in this matter... Thanx!
Dynamicly Changing A MC From A Variable
hi,
I want to get a variable out of a database, put it in an xml file and change the size of a movie clip based on that variable.
can anyone help me w/ the flash portion of this? I've found a few tutorials but they are far more complacated then I need.
so my xml file will have a given number, say 77.
I have a MC called Grower.
I want the MC to slowly change from 5 pixels wide to 77 pixels wide.
I think the syntax would be something like;
grower.width=grower.width + 5
do until grower.width >=77
does that make sense? I'm just not real sure of the syntax and how to get it from the xml page.
Thanks for any suggestions.
Dynamicly Load Jpg's From File Into Mc
I have like 100 buttons that all load a differend jpg files from a directory into a mc with the name "imageholder". It takes allot of time to define the buttons.
Is it possisible like give each button a number and then by an external file define what image to load in the imageholder
example:
button 1
button 2
external file:
1 = 1000.jpg
2 = 1010.jpg
Fade Mc Color Dynamicly?
Trying to figure out how to make the color of an mc fade dynamicly from one color to another based on the color chosen.
color1 = 16776960;
color2 = 3407616;
make button change from color1 to color2;
Any ideas?
Dynamicly Updating Dropdowns
ullo,
are these possible in flash? just wondering. ie, can i can control a dropdown menu via a database (i think thats how a dynamicly updating menu works yes?).
thanx
Help How Do Call A Function Dynamicly
Hey guys,
i try to call this function using eval
var a = "_root.report.showHighlight();"
eval(a);
however, i guess flash cannot evaluate a function, only variables. i was wondering if there is any way to get around this... thanx in advance
justin
How Do I Get The Name Of A Dynamicly Made Movieclip?
Hi there All, Man its been driving me nutts!!!!
I have been trying to get a heap of dynamicly created movieclips to have a getURL atached to it. so I need to know there names.
ARRRRR its killing me, Im not a coder.
this is the code. in the main stage,
---------------------------------------------
// register root as environment
Object.environment = this;
// create camera object
this.cam = {x:0, y:0, z:500, dx:0, dy:0, dz:-500};
// set environmental constants
this.fl = 1000;
// create 'space' to which all words will be attached
this.createEmptyMovieClip("space",1);
// center 'space' on the stage
space._x=300;
space._y=169;
// a string of words related to the wind
this.somewords = "wind breeze storm stormy tornado text space three dimensional infinite recursive instance object distort environmental atmospheric blow gush whoosh thrash whirl push roar rush caress flow swoop";
// convert the string of words into an array of words
this.wordList = new Array();
this.wordList = this.somewords.split(" ");
// create one instance for each word in the list
for (n=0;n<this.wordList.length;n++) {
// pick a word from the list
var word = Object.environment.wordList[n];
var x = random(600)-300;
var y = random(337)-169;
var z = random(Object.environment.fl*2)-Object.environment.fl;
// create an instance of the SpaceWord object
nombre = "word"+String(depth++);
initialization = {txtword: word, x: x, y: y, z: z};
space.attachMovie("spaceWord", nombre, depth, initialization);
}
this.onEnterFrame = function() {
this.cam.dz+=.5;
// move the camera to its destination
this.cam.x+=(this.cam.dx-this.cam.x)/10;
this.cam.y+=(this.cam.dy-this.cam.y)/10;
this.cam.z+=(this.cam.dz-this.cam.z)/30;
}
stop();
---------------------------------------------------------
and this is the code on the movieclip
#initclip
// constructor
function SpaceWord() {
// set up button functionality
this.btnSquare.onPress = function() {
//_root.current = this.name;
getURL(this._name);
// push the camera towards the word by setting destination just a bit in front
Object.environment.cam.dx = this._parent.x;
Object.environment.cam.dy = this._parent.y;
Object.environment.cam.dz = this._parent.z+Object.environment.fl*.9;
// disable and hide button
this.enabled = false;
this._visible = false;
};
// set continual function to render word
this.onEnterFrame = this.render;
}
// allow SpaceWord to inherit MovieClip properties
SpaceWord.prototype = new MovieClip();
// instance methods
SpaceWord.prototype.render = function() {
var zActual = Object.environment.fl+this.z-Object.environment.cam.z;
// has the object moved behind the camera?
if (zActual>0) {
// object is still visible
// calculate scale
var scale = Object.environment.fl/zActual;
// set position using camera as an offset
this._x = (this.x-Object.environment.cam.x)*scale;
this._y = (this.y-Object.environment.cam.y)*scale;
// set size
this._xscale = scale*100;
this._yscale = scale*100;
// set fog
this._alpha = 100 - 99 * zActual/Object.environment.fl*.5;
} else {
// object has moved behind camera
// reposition further down the line
this.z += Object.environment.fl*2;
// enable button
this.btnSquare.enabled = true;
this.btnSquare._visible = true;
}
};
SpaceWord.prototype.setWord = function(s) {
this.txtWord = s;
};
SpaceWord.prototype.setPosition = function(x, y, z) {
this.x = x;
this.y = y;
this.z = z;
};
// Connect the class with the linkage ID for this movie clip
Object.registerClass("spaceWord", SpaceWord);
#endinitclip
------------------------------------
Dynamicly Change Framerate
is there any function to change the framerate of a movie while playing?
(i have some ideas of how i can do it with setInterval, but i wanna check if there already is a function for it)
TOYTOTA
Loading Images Dynamicly
ok heres my issue...
I am loading images Dynamicly to my _root.background.walllayer
they load fine... but i cant get them to center...
here is my code for my button
on (release) {
loadMovie("wall2.jpg", "_root.background.walllayer");
_root.background.walllayer._x = 0;
_root.background.walllayer._y = 0;
gotoAndStop(2);
}
how do i set the X and Y axis Variables on my _root.background.walllayer layer?
Dynamicly Drawn Text.
I have a couple of centances that I want to be drawn in, ie, they appear as if someone was writing it. Unfortunately the font I am using is rather complecated. Does anyone have an Idea how I could achieve this? - Side from hundreds of shape tweens. I also want to be able to easily change the text easily.
Thankyou for your time.
Dynamicly Assign Action
Hi there!
I have the folowing .fla wich gets its data from a text file
From there I get a filename that I want to link to.
Everything works fine except the linkin' part.
I am using fscommand folder with .bat files to point to my final docs.
Enclosed is my .fla
Regards
Dynamicly Center Text Box
I need to keep a text box centered in the middle of the stage (horizontaly) no matter how wide the text box is (it will get bigger and smaller dynamically).
I also need:
How can I get a dynamic text box to always display the text at the bottom?
Similar to the "align bottom" with a cell in a table.
any help would be great.
Loading Color Value Dynamicly
Hi, I'm curently working on a site loading all it's parameters and content from external files. I actually have a problem setting the background color for some items.
I use this method where I tried in many way to load the rgb value from my external text file:
Code:
myColor = new Color(main_txt.bg_main);
myColor.setRGB(0x566D96);
Actually the line "_root.:couleur_header = myLoadVar.couleur_header;" load the rgb value 566D96, if I test it standalone with a text field it loads the value properly. Then I try to load this value to my actionscript, I tried with or witouth the eval argument:
Code:
_root.:couleur_header = myLoadVar.couleur_header;
myColor = new Color(header_status.status_bg);
myColor.setRGB(eval("0x" add couleur_header));
Right now the result is a blank value and a black background.
Any suggestions how I could get it to work?
Add Scroll Dynamicly¨( Any AS Gurus )
I am making a gallery in flash.
I have pictures loaded from xml file.
At one part of the sctript, iam resizing picture description automaticaly, as long as its needed.
How can i do the same for scrollbar, like show it if its only needed.
Iam lost please help me.
my code:
PHP Code:
function setDescription(attr){
ramka.desc._visible=true;
ramka.desc._x=Math.round(attr.WIDTH/2-120);
ramka.desc._y=Math.round(attr.HEIGHT/2-18);
ramka.desc.but.mytext=attr.INFOTEXT;
ramka.desc.but.up._visible=true;
ramka.desc.but.down._visible=false;
ramka.desc.brd._y = 71;
ramka.desc.tween("_alpha",100,0.3,mylinear,0.3);
ramka.desc.brd.info.autosize = "left";
ramka.desc.but.onPress=function(){
if(this.up._visible==true){
this.up._visible=false;
this.down._visible=true;
this._parent.brd.info.text=this.mytext;
var newy=this._parent.brd._y-this._parent.brd.info._height-10;
this._parent.brd.tween("_y",newy,0.3,mylinear,0);
}
else{
this.up._visible=true;
this.down._visible=false;
this._parent.brd.tween("_y",71,0.3,mylinear,0);
}
}
}
Thank you AS guru!s
Loading Multiple Swf's Dynamicly
Hey,
Im trying to make a preloader with a percentage bar that will load mulitple external swf/jpgs. ie. Load one thumbnail/image and then another placed next to it .
Is there any way to do this so that if you want to add more swf/images, you simply add the path somewhere? perhaps xml?
-Bowds
Dynamicly Adding Objects
I have a movie object in my library that I need to dynamicly add to my scene, position, and assign functions to... here is the basic functionality, I am not sure what function to use to add the movie clip.
code:
var currentClip = AddMyMovie(GenericButton); // Add My Button (Part that needs fixed)
currentClip._x = 25;
currentClip._y = 25;
currentClip.usageID = 25;
currentClip.onPress = function()
{
callUsageIDFunction(this.UsageID);
}
Target Dynamicly Created Mc
I cant see were i am going wrong. Trace returns undefined.
code:
trace ("holder=" + _parent.holder['news'+ID].txTitle.text);
How it's attached
code:
for (count = 0; count < result_lv.newsCount; count++) {
holder.attachMovie ("news", "news" + count, count);
holder["news" + count]._y = nextY;
holder["news" + count].newsTitle = result_lv["news" + count + "newsTitle"];
holder["news" + count].newsID = result_lv["news" + count + "newsID"];
holder["news" + count].newsDate = result_lv["news" + count + "newsDate"];
holder["news" + count].newsStory = result_lv["news" + count + "newsStory"];
nextY += holder["news" + count]._height - 2;
}
Anyone
Thanks
Changing Color Dynamicly
Hi all,
I got a map of The Netherlands divided into zipcode areas. I want to create a rollOver that works for all mc's (where each area is a different mc).
I've got this so far.
Code:
//Variabele active declareren:
active = 0;
//Hoeveel easing in de motion:
Ease = 6;
//Interval Variabele aanmaken
var nInterval:Number;
//Motion calculatie naar nieuwe positie
function calculation():Void {
mcArea._xscale += (endX-mcArea._xscale)/Ease;
mcArea._yscale += (endY-mcArea._yscale)/Ease;
}
//Button motion function zoom IN
//---------------------------------------
function activeFunction():Void {
endX = 120;
endY = 120;
calculation();
updateAfterEvent();
}
//Button motion function zoom OUT
//---------------------------------------
function inActiveFunction():Void {
endX = 100;
endY = 100;
calculation();
updateAfterEvent();
}
mc78.onRollOver = function():Void {
active = 78;
mcArea = this;
clearInterval(nInterval);
nInterval = setInterval(activeFunction, 30);
}
mc78.onRollOut = function():Void {
active = 0;
mcArea = this;
clearInterval(nInterval);
nInterval = setInterval(inActiveFunction, 30);
}
Now i do managed to change the scale of the MC number 78 (one of the areas), but i'm a little stuck on changing the color. How do i change the color of the MC('s) on rollOver?
Also any other suggestions on how to make it even easier would be much appreciated.
Thanks in advanced!
How Do U Resize A .swf That Is Loaded Dynamicly
I need to load a .swf file at runtime then resize it, but i can't figure out how to do it. He's what i'm doing now
holder.loadMovie("test.swf" )
holder is just a placer holder movie clip already on the stage. test.swf loads but It's much bigger than holder .swf and gets cut off.
Any thoughts?
thx
Dynamicly Populated Grid
Hello,
I hope that someone here can help me. Here it goes. I am populating my flash scene with a dynamic grid whitch consists of MCs that contain a button. There are generated in 90 buttons Y and 120 buttons X. Making a tottal of 10.800 buttons that are generated.
I will post my code for better understanding. I have two different MCs. One, square is normal, and the other, square_s is the occupied state of the button.
Now i would like to import a xml file, that would have a id number of the field and the state of it (normal or occupied). That id field would than be compared to the "k" variable in the code bellow. And than depending on the xml state of the button it would display the propper MC. I am a beginner at AS, so i would be very grateful for any help given to me.
In the code;
if(k==2 or k==2010){
duplicateMovieClip ("square_s", "square_s"+k, k);
// setting the x position of the duplicated square movieclips
setProperty ("square_s"+k, _x, distance*i);
// setting the y position of the duplicated square movieclips
setProperty ("square_s"+k, _y, distance*j);
// incrmenting the value of k
k++;
}
i was just testing to see if i set a random number of a field, if it will dissplay correctly. The new code should be something like this;
if(k==(id.variable.from.xml)){
And one more thing. How could i apply a link in the code bellow, so it woul generate dynamicly. Ex. index.php?field="(The K variable)"? I just dont know how to do it.
I hope it is not too complicated or anythink. I bet that it isnt going to be souch a problem for all you experts out there. I would like to thank everyone in advance. Thank you.
Code:
// Variable xgridlines is defined for number of grid lines on x axis
xgridlines = 91;
// Variable ygridlines is defined for number of grid lines on y axis
ygridlines = 91;
// Variable distance is defined for the distance between each grid
distance = 10;
// set property function is used to make the square movieclip invisible
setProperty ("square", _visible, false);
setProperty ("square_s", _visible, false);
// Variable k is used in the forloop for
// giving different instance name to the duplicated movieclips
k = 1;
// Making a nested forloop for duplicating the square movieclip
for (j=1; j<=xgridlines-1; j++) {
for (i=1; i<=ygridlines-1; i++) {
// duplicating the square movieclip
if(k==2 or k==2010){
duplicateMovieClip ("square_s", "square_s"+k, k);
// setting the x position of the duplicated square movieclips
setProperty ("square_s"+k, _x, distance*i);
// setting the y position of the duplicated square movieclips
setProperty ("square_s"+k, _y, distance*j);
// incrmenting the value of k
k++;
}else{
duplicateMovieClip ("square", "square"+k, k);
// setting the x position of the duplicated square movieclips
setProperty ("square"+k, _x, distance*i);
// setting the y position of the duplicated square movieclips
setProperty ("square"+k, _y, distance*j);
// incrmenting the value of k
k++;
}
}
}
Dynamicly Generated Menu
here are the vars created by my php page
Quote:
&title=topmenu&
&name0=Home&link0=http://bussiness.site/site1/index.php&type0=topmenu&
&name1=Contact Us&link1=http://bussiness.site/site1/index.php%3Foption%3Dcom_contact%26Itemid%3D3&type 1=topmenu&
&name2=News&link2=http://bussiness.site/site1/index.php%3Foption%3Dcom_content%26task%3Dsection% 26id%3D1%26Itemid%3D2&type2=topmenu&
&name3=Links&link3=http://bussiness.site/site1/index.php%3Foption%3Dcom_weblinks%26Itemid%3D23&ty pe3=topmenu&
&items=4&
i would like to have buttons who's name is the "&name" var and have the buttons generate themselves as to the data that is sent back from the d base...
So if i insert more data into the d base it will automatically generate another button in flash
each var has a "name" value "link" value and "type" value
|