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




Blinks With Dynamic Jpg's



Got stuck,

please look at http://www.xmoment.nl/flashTest/home.html

i got the images and text dynamic loaded, but i get a pesky blink between transitions.

Any ideas tips how to prevent this?

Part of my code

ActionScript Code:
function preload () {    var t = container.getBytesTotal (), l = container.getBytesLoaded ();    var tt = containerBG.getBytesTotal (), ll = containerBG.getBytesLoaded ();    if (t && l == t) { //wanna be sure container is loaded        //container._visible = true;        if (tt && ll == tt) { //be sure containerBG is loaded            //containerBG._visible = false;            clearInterval (myInterval);            gotoAndPlay (2); //both are loaded so go        }        // end if    }    //end if}//end preloadloadMovie (pathToPixs + "image" + bgPic + ".jpg", "containerBG");loadMovie (pathToPixs + "image" + whichPic + ".jpg", "container");myInterval = setInterval (preload, 5);



Ultrashock Forums > Flash > ActionScript
Posted on: 2004-07-14


View Complete Forum Thread with Replies

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

Dynamic Slideshow "blinks"
Hello

I am trying to make a dynamic slideshow, that allows the user to type the number of pictures in the html, and then naming them consecutively. (is this a word??)
It is working just fine, but I have a small problem when the loop starts over.

I made a scene to reset the counters

i = new Number();
i = 0;
max_pictures = new Number();
max_pictures = 4;

gotoAndPlay(nextScene);


And then the actual slideshow in the next scene: AS in first frame

i++;
if (i>max_pictures) {
i = 1;
}
picture = "billede"+i+".jpg";
i2 = i-1;
if (i2 == 0) {
i2 = 1;
}
picture2 = "billede"+i2+".jpg";
loadMovie(picture, _root.viewer_1);
loadMovie(picture2, _root.viewer_2);



I then placed a couple of empty movieclips with the proper instance names and animated them.

The problem is when the film loops and loads the next picture. I get a white "blink" every time...and it does not look good :·(

Is there a smart way arround this, or did I get it all wrong?

++Michael Domino

Random Blinks
Hey,

I wanted to know who i can make the squares at the top of my site matt|net randomly increase the brightness really fast and return to normal really fast.

L8

Movie Blinks
Hello,

I have a scrolling movie, based on this link:Link

I have adjusted it etc but the scolling is not working properly, when the bar is sliding, the righthand side blinks when it replaces the movie. Can somebody help me with the problem?

Regards

The moviefile is here:moviefile

Sub-Menu Blinks
In my main movie file I have an extra movie clip named lincolnHealthMenu which loads a sub-menu underneath the lincoln text. As you roll over the health programs button, the sub-menu appears fine, but, I'm having difficulty getting the menu to disappear as you roll over other buttons in the menu. As you roll over the health programs button again, you get a blink affect, which shouldn't happen. I tried setting frame labels in the separate movie clip and specifying on other button in this sub-menu to: gotoAndStop("framelabel") but that only worked first time.

I have posted a zip file. The extra sub menu is underneath the lincoln folder on frame 31. The action script should be relatively easy to follow. If anyone has suggestions...I would be appreciative.

http://midwestwebdesign.net/test/tour.zip

Last Page Blinks Before Preloader.
Hi, I am building a website for a client and need help as whilst looking through the site I found out that whenever I click a new link you will see the last page right before the preloader.

All my scenes are linked with one navigation swf, and all scenes have a white bg.

If It is unclear on what I am saying, the link is

zenyu.biz/home.html

If you surf around long enough you will manage to see what I mean. If anyone knows what is the problem, please let me know.

This problem only started after I decided to make the navigation a seperate swf.

Any help would be great.

Regards Kota.

MC Blinks Empty When Starting Over
So my problem is, I am using the Loader component in Flash 8 to dynamically load 3 images into my flash file. The images are loading fine, and each loader is inside of a MC.

I have each of my 3 MC's that have the loaders (sm_01, sm_02, sm_03) inside of a movieclip which will sit on the stage (sm_images_01). Now, I have sm_01-sm_03 all fading out to reveal the item beneath it which works.

The problem I am having is that once the movieclip reaches the end, it restarts but not without showing an empty frame that I can't account for.

I'm sure that sounds confusing...so I will also attach my fla, etc for ppl to take a look at.

Thanks in advance!

Externally Loaded Image Blinks
Hey everyone.

I've recently run into a little glitch with this site i'm working on.
On the about me page of the site, I have an external loaded image using the loadMovie function. That works fine... The only problem i'm running into is that it blinks after the animation of the mask that i'm using finishes. It then blinks again when a button is clicked to go to another page.
The problem can be see here http://frankelphotography.com

think you could help me out?

Thanks,
God Bless
Chase

SWF Blinks As Browser Opens New Page
It looks like there is no way to have a swf on each page which does not have to disappear with the old page before the new page is rendered - resulting in a "blink". Is that so? If that is the case, what is the best way to keep Flash functionality on a page without a blink? Dynamically loaded content? The page staying the same, and say using php to load new content? Is there a good place to go to read about that? Thanks.

Flash Website Page Blinks When Published..
Hi!
I have created a basic website in FLASH cs3 with 4 images. I have 4 buttons, and each image is in a movie clip and triggered by a button. Every layer has only one frame. I have not extended the timeline out.
When I test movie, everything is fine...but when i actually publish and go to the site, the images blink for a second before the page actually settles in.
Its like I have the opacity for the images at 100 for one frame and then down to zero for the next frame.
In actually, the images should all be at zero opacity until triggered.
Please help if you all have any suggestions.
As I said, the timeline is all on frame one.
THanks so much...IM pulling my hair out!

Preload External Swf's - Preloader Blinks For A Sec. And Disapears
here's my script:

bytes_loaded =Math .round (this .getBytesLoaded ()) ;
bytes_total =Math .round (this .getBytesTotal ()) ;
getPercent =bytes_loaded /bytes_total ;
this .loadBar ._width =getPercent *100 ;
this .loadText =Math .round (getPercent *100 )+ "%" ;
if (bytes_loaded == bytes_total ){

this .gotoAndPlay (3);

}


Why doesn't the preloader display in a normal way???? it blinks, showing "9%" and then disapears

Preload External Swf's - Preloader Blinks For A Sec. And Disapears
here's my script:

bytes_loaded =Math .round (this .getBytesLoaded ()) ;
bytes_total =Math .round (this .getBytesTotal ()) ;
getPercent =bytes_loaded /bytes_total ;
this .loadBar ._width =getPercent *100 ;
this .loadText =Math .round (getPercent *100 )+ "%" ;
if (bytes_loaded == bytes_total ){

this .gotoAndPlay (3);

}


Why doesn't the preloader display in a normal way???? it blinks, showing "9%" and then disapears

[MX2004]My Countdown Clock Still Blinks The Negative Numbers.
Hey! I have a countdown clock, that is told to check and see if the value of the days, hours, minutes, and seconds are less than 0 and if so, go to frame 13. My problem is that is still shows the negative numbers in the countdown for 1 second before going to frame 13. My check code is on the first frame, but it still waits 1 second.

Code:
currentDate = new Date(); eventDate = new Date(2007,8-1,24,23,35,00,00); var sum = 0; total = eventDate-currentDate; days = Math.ceil((total)/(1000*60*60*24)) - 1; sum += days * (1000*60*60*24); hours = Math.ceil((total - sum) / (1000*60*60)) - 1; sum += hours * (1000*60*60); minutes = Math.ceil((total - sum) / (1000*60)) - 1; sum += minutes * (1000*60); seconds = Math.ceil((total - sum) / (1000)) - 1; if (seconds == 60) seconds = "00"; if (length(minutes) == 1) { minutes = "0" + minutes; } if (length(seconds) == 1) { seconds = "0" + seconds; } calltime = (days+" days, "+hours+":"+minutes+":"+seconds+" ");
if (days < 0) {
gotoAndPlay("Scene 1", 13)
}
if (hours < 0) {
gotoAndPlay("Scene 1", 13)
}
if (minutes < 0) {
gotoAndPlay("Scene 1", 13)
}
if (seconds < 0) {
gotoAndPlay("Scene 1", 13)
}
and on frame 12

Code:
gotoAndPlay(1);
Is there anyway to make it go STRAIGHT to the 13th frame without showing these numbers? I hope this makes sense!
Thanks!
-Pippykk

Flash Blinks On The Left Side Of My Screen When I Use Mozilla.
If you go to http://www.womenswallstreet.com/ and you use a mozilla browser you will see flash animations blinking on the left side of the page.
I realized that this looks like a javascript issue as when I disable javascript on the page, the blinking disappears.

Does anyone have thoughts on what is happening?

Thank you.

Content "blinks" After The Preloading
I have created a preloader class. The main movie has two frames: An empty one and a second one with MCs. The class says "gotoAndStop(2)" on event complete.
Everything works as expected, BUT
On my second frame, I'm setting the alpha values to 0 (of every MC on the stage). Also, I use some scaleX and scaleY.
They all don't work for a moment.
Right after the proloading completed, all MCs shows themselves for a moment (like 0.5 seconds). After 0.5 seconds they all disappear (my "alpha" values start working...)

Why is it happening? Is there a solution to stop the "blinking"?
I know it's because of the preloading. But I don't know why.

Thanks,
POV

Why Preloader "blinks" With Number 100?
Just for a short second it shows the number 100 before it starts counting up to 100. Why?


Code:

// TYPE OF TWEENS
var tweentype_resize:String = "easeOutExpo";
var tweentype_fadeOut:String = "easeInSine";
var tweentype_fadeIn:String = "easeInSine";

// SPEED OF TWEENS
var speed_resize:Number = 0.4;
var speed_fadeOut:Number = 0.4;
var speed_fadeIn:Number = 0.4;

// BUTTONS
function hitButton(nbrID) {
btn = _root.nav["btn"+nbrID];
btn.nbrID = nbrID;
btn.onRollOver = function() {
this.alphaTo(100, speed_fadeIn);
};
btn.onRollOut = function() {
this.alphaTo(30, speed_fadeOut);
};
btn.onRelease = function() {
for (var i = 1; i<=20; i++) {
_root.nav["btn"+i].alphaTo(30, speed_fadeOut);
_root.nav["btn"+i].enabled = true;
}
this.alphaTo(100, speed_fadeIn);
this.enabled = false;
fadeOut(this.nbrID-1);
}
}

for (var i = 1; i<=20; i++) {
_root.hitButton(i);
}

// IMAGE VIEWER
bar._visible = false;
containerMC._alpha = 0;
picinfo._alpha = 0;
containerMC.swapDepths(2);

MovieClip.prototype.loadPic = function(pic) {
this.loadMovie(pArray[pic]);
this._parent.onEnterFrame = function() {
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
bar._visible = true;
per = Math.round((l/t)*100);
if (t == l && containerMC._width>0 && containerMC._height>0) {
var w = containerMC._width, h = containerMC._height;
resizeMe(w, h);
bar._visible = false;
picInfo.text = tArray[pic];
if (picInfo.text == "undefined") {
picInfo._visible = false;
} else {
picInfo._visible = true;
}
delete this.onEnterFrame;
} else {
//bar._width = w;
bar.preInfo.text = per;
}
}
}

function resizeMe(w, h) {
//border tween:
border.tween(["_width", "_height"], [w, h], speed_resize, tweentype_resize);
//pic and picinfo fade in:
containerMC.alphaTo(100, speed_fadeIn, tweentype_fadeIn, speed_resize);
picInfo.alphaTo(100, speed_fadeIn, tweentype_fadeIn, speed_fadeIn);
//pic position:
containerMC._x = border._x;
containerMC._y = border._y;
}

//LOAD CSS
var cssStyles:TextField.StyleSheet = new TextField.StyleSheet ();
cssStyles.onLoad = function (success:Boolean):Void {
if (success) {
picInfo.styleSheet = cssStyles;
} else {
picInfo.text = "Texten kunde inte laddas.";
}
}
cssStyles.load ("styles/styles.css");

// LOAD XML
picInfo._alpha = 0;
picInfo.html = true;
picInfo.multiline = true;
picInfo.wordWrap = true;
picInfo.autoSize = "left";
var pArray = new Array();
var tArray = new Array();

var myXML:XML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function (success:Boolean):Void {
if (success) {
trace("success: "+this.status);
var xmlData = this.firstChild;
for (var i = 0; i<xmlData.childNodes.length; i++) {
pArray.push(xmlData.childNodes[i].childNodes[0].firstChild.nodeValue);
tArray.push(xmlData.childNodes[i].childNodes[1].firstChild.nodeValue);
}
// navigation
var picNum = parseInt(i);
for (var i = 1; i<=picNum; i++) {
_root.nav["btn"+i].topText_mc.text = [i];
_root.nav["btn"+i].alphaTo(30, speed_fadeIn, tweentype_fadeIn, speed_fadeIn);
}
_root.nav.btn1.alphaTo(100, speed_fadeIn, tweentype_fadeIn, speed_fadeIn);
_root.nav.btn1.enabled = false;
// load pictures
containerMC.loadPic(0);
picInfo.alphaTo(100, speed_fadeIn, tweentype_fadeIn, speed_fadeIn);
} else {
picInfo.text = "Texten kunde inte laddas.";
}
}
myXML.load("main"+num+"/xml/sub"+itemnum+".xml")

//FADE OUT IMAGES AND TEXT
function fadeOut(pic) {
containerMC.alphaTo(0, speed_fadeOut, tweentype_fadeOut, 0, {scope:containerMC, func:containerMC.loadPic, args:[pic]});
picInfo.alphaTo(0, speed_fadeOut, tweentype_fadeOut);
}

Mc Fades In Uneven At 100 Alpha- It Blinks Not Fades
the word "communications" in the flash logo fades in, but it sort of bumps into full transparency right at the end. I'd like the fade-in to stay consistent. this was done in AS2.

http://www.olanbrewer.com/flashtest.html

here's the code for the last frame of the animation:

stop();
(comm_mc is the instance name)
comm_mc.onEnterFrame = function(){
if(this._alpha < 100){
this._alpha += 2;
trace(this._alpha);
}
}

the trace statement shows that the rate it's fading in is at @1.95/frame and not the 2. what's with that? I tried using Math.round to no avail.
ex:1.953125, 3.90625, 5.859375...
as soon as it crosses 100 it's popping full brightness.

R

My Loaded MC "blinks"
anybody have any idea why a loaded MC would be there then "blink" out.
it seems to "blink" out when the movie loops to the first frame...

MC "Blinks" On LoadMovie
Hello, first off I'd like to say I've been coming to this site for quite a while and always been able to find an answer to my problem with a few hours searching and tweaking other's advice to suit my needs. I don't use flash too often but when I do I've learned a lot here. Unfortunately with this current problem I saw a few similar posts but no real solutions. If I missed a thread that's out there please let me know and I'll be on my way and thanks for the help. If not so much, let's get to it.

What I'm trying to do is load external swf files that happen to contain an AVI. I have a number of buttons that the user can click on to watch these videos in any order they choose. Everything works fine with the movies loading into a Movie Clip I have on the stage with the loadMovie command. I can control, start and stop the clips just fine.

The problem is that even though the videos don't need to be viewed in order they are all of the same machine being taken apart and when you click the buttons to load the different steps there is a brief flash where the Movie Clip disappears and I can see whatever is behind it. This totally breaks the cohesiveness of the presentation. I'm wondering if there is a solution to this. Maybe my code is sloppy or I should be using a different command.

If anyone would like to take a look, I zipped up an example that shows my problem. It's the main.fla and 3 SWFs that it loads. I'm using Flash MX. Thanks for any help.

If anyone would rather just see the code I'm using to load the movie let me know and I’ll post it.

"blinks" Between Pages?
Every once in a while I want to build a css site and use a flash header for animation and navigation. When it comes to the navigation I am loading in another html/css page(that includes the exact same flash movie in the header) for each menu item. When I do this there is a quick "blink" of the flash header movie between pages. I try transparency settings and background color setting to no avail. Why isn't it cached so that the "blink" doesn't occur? You know, if you do the same with a graphic the blink doesn't happen?

Free Flash Source For Dynamic Slideshow With Automatic Thumnbails And Dynamic Text?
Is there any free flash source for dynamic images slideshow with automatic thumnbails and dynamic text / caption just like the one here:
http://images.businessweek.com/ss/06.../slideshow.htm
or this one:
http://www.clubparis.net/gallery

TIA

Dynamic Window Shopping Using Tween Class : Unable To Load Dynamic Data
hi guys, i am a newbie here and in flash too. I've learnt ActionScript basics from this forum and i hope i get a solution for my problem.I am doing this window shopping gallery for my company but iam stuck in the middle of nowhere.I am attaching the files so that u can have a look at it. the gallery is xml driven.
when a user hovers to the left side of the gallery tween starts and the stores move in a perspective angle. i am placing the code here for xml loading which is in 1st frame

ActionScript Code:
stop();
var tracker:Number = 0;
var total:Number;
var totProd:Number;
var storeId:Array = [];
var storeName:Array = [];
var storeLogo:Array = [];
var storeDesc:Array = [];
var pcode:Array = [];
var price:Array =[];
var pdesc:Array =[];
function loadXML(loaded) {
    if (loaded) {
        rootNode = xmlData.firstChild;
        total = rootNode.childNodes.length;
        //trace("total "+total+" stores");
        //trace("-------------------------Description---------------------");
        for (i=0; i<total; i++) {
            storeId[i] = rootNode.childNodes[i].attributes.sid;
            storeName[i] = rootNode.childNodes[i].attributes.sname;
            storeLogo[i] = rootNode.childNodes[i].attributes.slogo;
            storeDesc[i] = rootNode.childNodes[i].attributes.sdesc;
            totprod = rootNode.childNodes[i].childNodes.length;
            //trace("Store ID : "+storeId[i]);
            //trace("Store Name : "+storeName[i]);
            //trace("Store Logo : "+storeLogo[i]);
            //trace("Store Desc : "+storeDesc[i]);
            //trace("Products in Store : "+totprod);
            for (j=0; j<totprod; j++) {
                pcode[j] = rootNode.childNodes[i].childNodes[j].attributes.pcode;
                price[j] = rootNode.childNodes[i].childNodes[j].attributes.price;
                pdesc[j] = rootNode.childNodes[i].childNodes[j].attributes.pdesc;
                //trace("Product Code : "+pcode[j]);
                //trace("Price : "+price[j]);
                //trace("Product Desc : "+pdesc[j]);
            }
            //trace("______________________________________________________");
            //trace("------------------------------------------------------");
        }
    } else {
        trace("unable to load XML file");
    }
}
_root.prloadr_mc.onLoad = function() {
    total = getBytesTotal();
};
_root.prloadr_mc.onEnterFrame = function() {

    loaded = getBytesLoaded();
    if (loaded>=total) {
        _root.gotoAndStop(2);
    }
};
var xmlData:XML = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("windowshopping.xml");


and in the second frame the code is as follows:


ActionScript Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
_root.store1_mc.dyn_txt.text = tracker;
_root.store2_mc.dyn_txt.text = tracker+1;
_root.store3_mc.dyn_txt.text = tracker+2;
_root.store4_mc.dyn_txt.text = tracker+3;
var initial:Boolean = true;
_root.enter_mc._visible = false;
_root.backward_btn.useHandCursor = false;
var t1:Tween = new Tween(_root.store1_mc, "_x", None.easeNone, 645.7, 1394.1, 1.5, true);
t1.stop();
var t2:Tween = new Tween(_root.store1_mc, "_y", None.easeNone, 363.9, 335.7, 1.5, true);
t2.stop();
var t3:Tween = new Tween(_root.store1_mc, "_width", None.easeNone, 548, 1009.2, 1.5, true);
t3.stop();
var t4:Tween = new Tween(_root.store1_mc, "_height", None.easeNone, 644.4, 1186.5, 1.5, true);
t4.stop();
var t5:Tween = new Tween(_root.store2_mc, "_x", None.easeNone, 240.9, 645.7, 1.5, true);
t5.stop();
var t6:Tween = new Tween(_root.store2_mc, "_y", None.easeNone, 379.8, 363.9, 1.5, true);
t6.stop();
var t7:Tween = new Tween(_root.store2_mc, "_width", None.easeNone, 298.4, 548, 1.5, true);
t7.stop();
var t8:Tween = new Tween(_root.store2_mc, "_height", None.easeNone, 350.8, 644.4, 1.5, true);
t8.stop();
var t9:Tween = new Tween(_root.store3_mc, "_x", None.easeNone, 15.7, 240.9, 1.5, true);
t9.stop();
var t10:Tween = new Tween(_root.store3_mc, "_y", None.easeNone, 390.1, 379.8, 1.5, true);
t10.stop();
var t11:Tween = new Tween(_root.store3_mc, "_width", None.easeNone, 174.3, 298.4, 1.5, true);
t11.stop();
var t12:Tween = new Tween(_root.store3_mc, "_height", None.easeNone, 188.8, 350.8, 1.5, true);
t12.stop();
var t13:Tween = new Tween(_root.store4_mc, "_x", None.easeNone, -113.7, 15.7, 1.5, true);
t13.stop();
var t14:Tween = new Tween(_root.store4_mc, "_y", None.easeNone, 394.9, 390.1, 1.5, true);
t14.stop();
var t15:Tween = new Tween(_root.store4_mc, "_width", None.easeNone, 95.9, 174.3, 1.5, true);
t15.stop();
var t16:Tween = new Tween(_root.store4_mc, "_height", None.easeNone, 103.8, 188.8, 1.5, true);
t16.stop();
function myTween() {
    t1.start();
    t2.start();
    t3.start();
    t4.start();
    t5.start();
    t6.start();
    t7.start();
    t8.start();
    t9.start();
    t10.start();
    t11.start();
    t12.start();
    t13.start();
    t14.start();
    t15.start();
    t16.start();
}
function myTweenRepeat() {
    _root.store1_mc.dyn_txt.text = tracker;
    _root.store2_mc.dyn_txt.text = tracker+1;
    _root.store3_mc.dyn_txt.text = tracker+2;
    _root.store4_mc.dyn_txt.text = tracker+3;
    t1.start();
    t2.start();
    t3.start();
    t4.start();
    t5.start();
    t6.start();
    t7.start();
    t8.start();
    t9.start();
    t10.start();
    t11.start();
    t12.start();
    t13.start();
    t14.start();
    t15.start();
    t16.start();
}
function myTweenStop() {
    trace("Stopped");
    t1.stop();
    t2.stop();
    t3.stop();
    t4.stop();
    t5.stop();
    t6.stop();
    t7.stop();
    t8.stop();
    t9.stop();
    t10.stop();
    t11.stop();
    t12.stop();
    t13.stop();
    t14.stop();
    t15.stop();
    t16.stop();
}
function myTweenResume() {
    trace("Resumed");
    t1.resume();
    t2.resume();
    t3.resume();
    t4.resume();
    t5.resume();
    t6.resume();
    t7.resume();
    t8.resume();
    t9.resume();
    t10.resume();
    t11.resume();
    t12.resume();
    t13.resume();
    t14.resume();
    t15.resume();
    t16.resume();
}
_root.forward_btn.onRollOver = function() {
    if (initial) {
        trace("Initial");
        myTween();
    } else {
        trace("Resuming...............");
        myTweenResume();
    }
    t1.onMotionFinished = function() {
        tracker++;
        trace("Repeat");
        myTweenRepeat();
    };
    _root.forward_btn.useHandCursor = false;
    _root.leftarrow_mc._visible = false;
    _root.enter_mc._visible = true;
    _root.enter_mc.gotoAndPlay("s2");
    _root.tooltip_mc.gotoAndPlay("s1");
    initial = false;
};
_root.forward_btn.onRollOut = function() {
    myTweenStop();
    _root.leftarrow_mc._visible = true;
    _root.tooltip_mc.gotoAndPlay("s2");
    _root.enter_mc.gotoAndPlay("s1");
};


the problem is, I cant change content in store dynamically.
please anyone help me out from this situation. i will be waiting for replies.
Thanks in advance.

Dynamic Vars, Dynamic Paths Using Variables And External Text Files
Hi there,

first off, apologies for the long post, but its a tricky problem to explain... and on my first post too! (sorry )
Im have a bit of bother with flash calling variables from a text file, and using them to make paths to other variables, and to control the amount of time a duplicate clip occurs. The first of these 2 problems is this:

Im loading a text file "content.txt" into _root. (this works fine)
it contains the variables:

webclipcount=2
&webhenry=hello hello
&webbutton01=henry

on the main timeline I have this button

on(press){
sectiontitle="web"
clipcount=webclipcount
}

there is a text box on the main timeline with variable name of bodycopy.

on a clip on the main timeline I have this;

onClipEvent (enterFrame) {
if (num< _parent.clipcount) {
duplicateMovieClip(thebutton, "button"+depth, depth);
this["button"+depth].name = _parent[_parent.sectiontitle+"button"+num];

this gives button01 the name henry- this works.

on the duplicated clip I have these actions:

on(mouseDown){
_parent._parent.bodycopy=_parent._parent[_parent._parent.sectiontitle+this.name]
}

so we end up with a path like:

_parent._parent.bodycopy=_parent._parent.webhenry

and it in turn should make the textbox on the main timeline contain "hello hello"

but it doesnt.

also for the duplicating clip, unless i use:

onClipEvent (enterFrame) {
if (num< 2) {.....
<snip>

it wont work either. it seems neither can be dynamic/ pulled from the text file. (well, i can get them to work!)

If I use direct paths like:

on(mouseDown){
_parent._parent.bodycopy="bloody hell it works!"
}

and

onClipEvent (enterFrame) {
if (num< 2) {.....
<snip>

it works, but not if they are dynamicly set from the txt file...
Anyone care to shed some light onto this? its doing my head in!
thanks in advance or the help.

cheers,

chris

Mouseless, Autoscrolling, Dynamic Tweening, Dynamic Text...
I am having the darndest time finding help on this even though it seems like a common task (ok done venting)

What I need is this:

A dynamic text field (from txt file) that will autoscroll vertically. I know that I can do this by motion tweening a movie clip containing my dynamic text, but heres the thing: this source txt file will be updated daily (daily events). Some days it will be a few lines of txt (no scrolling necessary). Some days it may be 500 or more lines of text. So simply motion tweening my movie clip a fixed speed and distance will not work. I need the scroll speed, text box size, and scroll distance to be dynamic.

Please help us. The hack that made our kiosk made it almost impossible to open, so it takes me forever to open it and i don't want to do that every day... oh, you didn't need to know that, sorry.

An .fla or a tutorial would be a huge help as I am not action script savy, yet.

Thanks in advance!

Dynamic JPGS, Dynamic Images, Load Image
Just a little not for those who have problems using dynamic loaded jpgs.
If you want to dynamically load some jpgs here is some code I picked up off the forum


Code:
//Step1
createEmptyMovieClip("img",0);
img._visible=false;
//Step2
img.loadMovie("test.jpg");
//Step3
this.onEnterFrame=function(){
BLoaded=img.getBytesLoaded();
BTotal=img.getBytesTotal();
percent=BLoaded/BTotal*100;
//Step4
if(BLoaded == BTotal && BLoaded>0){
img._width=726;
img._height=641;
img._visible=true;
delete this.onEnterFrame;
img._x=0;
img._y=0;
}
}
When you save your JPG in photoshop it gives you a few options for saving your jpg.
1) BASELINE (STANDARD)
2)BASELINE (OPTIMIZED)
3)PROGRESSIVE

It has to be a baseline image, for whatever reason. No clue!

Creating Dynamic Links Inside Of Dynamic Menus
hello, I am having a problem adding links dynamically inside of a menu that was created dynamically. Look here to see the movie. All of the menus are created dynamically with a for loop iterating through an array. As each menu is created I want the links to be created also. For this i have used nested for loops. My problem is labeling the link text. Here is all of my code.
code:
stop();

function default_location(){
topX = 10;
topY = 5;
bottomX = 10;
bottomY = 590;
bar._x = topX;
bar._y = topY;
}
default_location();

//number of menus
var numMenus = 6;

var menuTop = new Array();
var locationY = 5;
var locationX = 10;

//define the menu headings
var top0 = "New Home Buyer Program";
var top1 = "Franchise Opportunities";
var top2 = "Broker/Realtor Program";
var top3 = "Mortgage Broker Program";
var top4 = "Home Builder Program";
var top5 = "Company Info";

var menu0 = new Array();
//New Home Buyer Program Menu Items
menu0[0] = ["Get the Home of Your Choice Now", "www.nhba.com"];
menu0[1] = ["The NHBA Application Process", "www.nhba.com"];
menu0[2] = ["Find an Office", "www.nhba.com"];
menu0[3] = ["Complete an Application", "www.nhba.com"];
menu0[4] = ["Check the Status of Your Application", "www.nhba.com"];
menu0[5] = ["Available Property Specials", "www.nhba.com"];

//Franchise Opportunity Menu Items
var menu1 = new Array();
menu1[0] = ["The NHBA Franchise Experience", "www.nhba.com"];
menu1[1] = ["NHBA for the Franchisee", "www.nhba.com"];
menu1[2] = ["Exclusive Tools and Technology", "www.nhba.com"];
menu1[3] = ["FAQ's/Resources", "www.nhba.com"];
menu1[4] = ["Franchise Facts", "www.nhba.com"];
menu1[5] = ["Discovery Days Registration", "www.nhba.com"];
menu1[6] = ["Franchise Testamonials", "www.nhba.com"];
menu1[7] = ["Apply to be a Franchsie", "www.nhba.com"];

//Broker/Realtor Program Menu Items
var menu2 = new Array();
menu2[0] = ["What Brokers & Realtors Need to Know", "www.nhba.com"];
menu2[1] = ["NHBA for the Realtor", "www.nhba.com"];
menu2[2] = ["Request Information", "www.nhba.com"];

//Mortgage Broker Program Menu Items
var menu3 = new Array();
menu3[0] = ["What Mortgage Brokers Need to Know", "www.nhba.com"];
menu3[1] = ["NHBA for the Mortgage Broker", "www.nhba.com"];
menu3[2] = ["Request Information", "www.nhba.com"];

//Home Builder Program Menu Items
var menu4 = new Array();
menu4[0] = ["What Homebuilders Need to Know", "www.nhba.com"];
menu4[1] = ["How Lease-to-Own Works for You", "www.nhba.com"];
menu4[2] = ["Request Information", "www.nhba.com"];

//NHBA Company Info Menu Items
var menu5 = new Array();
menu5[0] = ["Company Overview", "www.nhba.com"];
menu5[1] = ["Contact Us", "www.nhba.com"];
menu5[2] = ["Management Team", "www.nhba.com"];
menu5[3] = ["Corporate Media Kit", "www.nhba.com"];
menu5[4] = ["What People are Saying", "www.nhba.com"];
menu5[5] = ["Pride in Partnership", "www.nhba.com"];
menu5[6] = ["Privacy & Security Policies", "www.nhba.com"];
menu5[7] = ["Site Map", "www.nhba.com"];


var numMenusLeft = numMenus;

//Create the Menus
for(i=0; i < numMenus; i++){
bar.duplicateMovieClip("bar"+(i), i+1);

_root["bar"+(i)]._y = locationY; //sets the initial location

locationBottom = bottomY - (28*numMenusLeft);//sets the bottom location

menuTop[i] = [locationY,locationBottom,_root["top"+(i)]];//assigns the menuTop array with the instance info
_root["bar"+(i)].menuName_txt = menuTop[i][2];
_root["bar"+(i)].name = "bar"+(i);

_root["bar"+(i)].id = i; //assigned id as array index (id = 0, 1, 2....)
_root["bar"+(i)].up = true;

locationY += 28; //increment locations for next menu
numMenusLeft-=1;
var len = _root["menu"+(i)].length;
//trace(len);
var linkY = 45;
var obj = new Array();

x = i;
for (j=0; j<len; j++){
//THIS IS THE PART THAT IS NOT WORKING
obj[j] = _root["bar"+(i)].link.duplicateMovieClip("link"+(j), j);

//_root["bar"+(i)].createEmptyMovieClip("mc"+j, j);
//["mc"+(j)].createTextField("txt", j, 0, linkY, 130, 40);

trace(obj[j]);
//IT DOESNT ASSIGN THE TEXT TO THE LINK
obj[j].link_button.link_text.text = _root["menu"+(i)][j][0];

obj[j]._y = linkY;
linkY += 30;


}
_root["bar"+(i)].link._visible = false;
//trace(obj.length);
for (k=0; k<obj.length; k++){
trace("Link:"+k+obj[k]);

}
}

_root.bar._visible = false;

function moveMenus(button_id){ //button id is coming in as the array index (0,1,2...)

//loop through all of the menus
for (i=0;i<=(menuTop.length - 1); i++){

if(i<button_id){
if (_root["bar"+(i)].up == false){
easeUp(i)}
}else if(i == button_id){
if (_root["bar"+(i)].up == false){
easeUp(i)}
}else if (i>button_id){
if (_root["bar"+(i)].up == true){
easeDown(i)}
}
}
}
/*This is how to use the MX easing tween:
var tabUp = new mx.transitions.Tween(movieClip, "_y", mx.transitions.easing.Bounce.easeOut, beginCordinate, endCordinate, time);
*/
function easeUp(menu) {
var tabUp = new mx.transitions.Tween(_root["bar"+(menu)], "_y", mx.transitions.easing.Strong.easeOut, menuTop[menu][1], menuTop[menu][0], 12);
_root["bar"+(menu)].up = true;
}
function easeDown(menu) {
var tabUp = new mx.transitions.Tween(_root["bar"+(menu)], "_y", mx.transitions.easing.Strong.easeOut, menuTop[menu][0], menuTop[menu][1], 24);
_root["bar"+(menu)].up = false;
}


Any help would be MUCH appreciated.

Dynamic Aligning Input And Dynamic Text Box (flash 5 / 6)
Hi the title says it all really. i need to know how to dynamically align input and dynamic text boxes in (flash 5 / 6) so on a button press the text moves to the left or centred

thanks!

Dynamic Mask For Dynamic Text Won't Working Any Body Pls Help
Im' supposed to make a scrollable gridlike simulation with using MC. Inside that MC there are dynamic text area as cell in which its text will be updated dynamically.

Now i have a strange prob that when i use setMask to mask that grid MC it won't working


I have the MC name 'grid'
above that another MC name 'msk'

code is like tha
grid.setMask("msk");

it only shows the full grid instead of masking area.

Dynamic Text : Dynamic Height (depending On Content)
Hi people.

Im working on a website, and in some part there is a dynamic text space that sets its width depending on the resolution.

But well, I want the text to be sitting downside of my webpage. For this (I guess) I need to set the height of the space to its contents, so that I can use the textspace height as a unit, for putting it to the ground
(myTextSpace.y=stage.StageHeight - myTestSpace.height)

But well, I do not know, if there is any way to set the textspace height to its contents.

I hope I'm clear, thank you.

Dynamic Text Within Dynamic Movie Clip Loops
Ok my predicament. I am trying to create thumbnails, but instead of using pictures as the thumbnails I would like to have text, formatted blah blah for people to select. Now the code I am trying to adapt is fine and dandy to get working with pictures, so I know the part of this code that creates the movie clip is fine. However I cannot seem to dynamically create the text boxes within the movie clips. I need to have them within the movie clips so the opacity will change when they are hovered over.

Code:

currentName = "t"+k
thumbnail_mc.createEmptyMovieClip(currentName, thumbnail_mc.getNextHighestDepth());
thumbnail_mc.currentName.createTextField("text"+cu rrentName, thumbnail_mc.currentName.getNextHighestDepth(), 0, 0, 244, 28)
thumbnail_mc.currentName.text="test"

k will be changing anyway for each time through taht a movie clip is made hence why they will need different names.

Any help...hope this can be understood.

Accessing Dynamic Text Within Dynamic Added Movieclip.
Hi there.

I'm trying to access and change a dynamic text field within a dynamically added movieclip.

This is how I'm trying to accomplish that;


ActionScript Code:
uButton = attachMovie("_button",arr_videos[i][1], ++uDepth);
  uButton._x = uButtonStartX;
  uButton._y = uButtonStartY + uButtonDistance * uDepth  uButton.btn_name.text = "button name";

btn_name is the name of the dyn. textfield.

But this does nothing.. What am I doing wrong?

Thanks for your help

Samuel

Dynamic Text Field Receiving Dynamic Variables...
or something like that . . .

This is my problem: I'm generating _global variables via XML. Each variable represents different types of copy, of varying lengths. For Example:

_global.introduction = xmlDoc_xml.firstChild.firstChild.nodeValue;
_global.body = xmlDoc_xml.firstChild.firstChild.firstChild.nodeVa lue;
_global.summary = xmlDoc_xml.firstChild.firstChild.firstChild.firstC hild.nodeValue;

I want to create ONE text field, with scrolling, that will act as a template to house all types of content. I've assigned a variable that equals "content" to this text field. . . My problem is, I can't get the text field variable (content) to dynamically swap for the global variable (_global.introduction) in order to display the proper content.

This seems simple, but something's not working for me. Any thoughts? . . . BIG thanks in advance!

Dynamic Multiple Choice Quiz - How To Make It Dynamic
Hi all,
I'm a programming-in-Flash-other-than-basic-stuff-newbie and would appreciate any help on a project I need done this week. I've been using the multiple choice quiz template. It's for an online pop trivia game using covers. Here's the basics:

You see three pictures and pick one of them. You are taken to a question about the cover. You answer it and your right or wrong choice tally starts. You are then taken to the "choose a cover from the 3 pics" screen again. Only this time the picture you have chosen is replaced by another picture so that there are the two pics that were up already that you didn't choose and 1 new one. You choose one of the 3 and answer it. The process continues for around 10 questions.

I'm thinking of a data pool of about 20 pics with each pic attached to one question which I can use the multiple choice componant for.

Any suggestions?

Please look here: http://www.sircuss.com/test/otcquiztest.swf

sircuss

XML Loading, Dynamic Buttons, Dynamic Text Fields...
My last thread kind of died, I guess, so here's another one that I hope will get me some help; it has an updated FLA attached and what I think to be some better descriptions of my problems... I know I'm totally indebted to whomever will help, but this is an emergency and I need some timely advice.

so here's the FLA, XML, and some sample images: kirupaTest2.zip

1. I pretty much have the enlarged pictures loading I guess, which was my major problem before, but it doesn't matter because I can't get the code to "know" which of the dynamic thumbnails has been clicked (by "know", I mean return an index value, say 0 through 7 if there are 8 projects, that I can use to access that particular project in the array of 8 projects in the rest of the code)... So if the third movieclip thumbnail were clicked, I'd like "2" to come up somehow... I've tried this code, which is kind of lame, I know, based off of the idea of each of the thumbnail movieclips' names ending in their index number:

ActionScript Code:
//"this" is the button that was pressed; would return a string ending in//thumberMC_<number of whichever movieclip thumb was clicked>var: testString:String = this; //storing how many characters are in the string above...var: stringNumb:Number = testString.length;//using that value to take off the last string (hopefully the number)var: finalString = testString.charAt(stringNumb);


And that didn't work. (The code above was entered around line 71 in the layer "actions"; it's gone now)


2. An even bigger problem is I have some containers being drawn dynamically from height and width values pulled from an XML file. When I test the code that creates the objects using hard-coded values, it works fine; say if I put 481 in for the width and 375 for the height. But if I try to do it (sort of) dynamically like:


ActionScript Code:
var picHeight:Number = projects[5].bigPics[0].picHeightvar picWidth:Number = projects[5].bigPics[0].picWidth


it gets all screwed up; please try it for yourself in the supplied FLA. It's hard to describe what goes wrong; some things are drawn, and others aren't. I think it's because the objects are trying to draw before they have the data to draw with. This can be seen at lines 129 and 130.


3. Lastly, there's a dynamic textfield I'm trying to create that never shows up for some reason. Again, you could see in the FLA (in the "createDrawer" function around line 424).

If I can clarify, please let me know.

Dynamic Video Playlist And Dynamic Text Articles
Hi all, hope you can help me..?

I have the task of creating a Dynamic Video Playlist to be incorporated in a FLASH 8/HTML site. The site owner should then be able to upload their recorded videos. The client will be using a low budged camera. I am planning to suggest a video format to the client that will suit me best.

In addition I also need to create a section where text articles will be posted by the site owner.

I am a beginner in Actionscript 2.0, and I have Flash 8 installed in my PC.

Can anyone recommend some FLA source files to get me started, and a tutorial? I've seen some tutorials, but they are either too complicated or don't attend my needs.

Many thanks!

[Flash 8] Dynamic Movieclips With Dynamic Movie Clips : Help
Hello, is there a way to:
1. create an empty movieclip (zone1)
2. create a movieclip in zone1 (zone1.contentMC)
3. create an empty mask movieclip in zone1 (zone1.maskMC)
4. draw a filled rectangle into zone1.maskMC
5. set the zone1.maskMC as the mask for zone1.contentMC
6. load content at any time into zone1.contentMC

I just spent 15 minutes putting together a post only to have it say I was not logged in (session timeout I guess).. lost the post data on backspace. Here is the code I'm working with.. as you can see with the comments I've been at this for a while. I want to iterate through zone array.. setup empty movies.. then a contents and mask movie inside each movie, draw a rectangle in the mask movie and then set the mask before I put contents into the content MC.


Code:

stop();
var colorArray:Array = new Array("0xFF0000", "0x0000FF", "0x00FF00");
function drawRec(endX, endY, targetMovie:MovieClip) {
trace("drawing a mask in "+targetMovie+" with "+endX+", "+endY);
rndColor = Math.round(2*Math.random());
targetMovie.beginFill(colorArray[rndColor], 100);
targetMovie.moveTo(0, 0);
targetMovie.lineTo(endX, 0);
targetMovie.lineTo(endX, endY);
targetMovie.lineTo(0, endY);
targetMovie.lineTo(0, 0);
targetMovie.endFill();
}
function makeZones() {
atZone = 0;
for (zones in zoneArray) {
// create zone movie
this.createEmptyMovieClip("zone"+atZone, this.getNextHighestDepth());
// move new zone to it's correct x and y
this["zone"+atZone]._x = zoneArray[zones][0];
this["zone"+atZone]._y = zoneArray[zones][1];
// create contentMC
this["zone"+atZone].createEmptyMovieClip("contentMC",1 );
trace(this["zone"+atZone].contentMC);
// create Mask
this["zone"+atZone].createEmptyMovieClip("maskMC", 2);
trace(this["zone"+atZone].maskMC);
//draw Mask
drawRec(zoneArray[zones][2], zoneArray[zones][3], this["zone"+atZone].maskMC);
contentMC.setMask(maskMC);
loadMovie("images/0.jpg", contentMC);
//set the mask for the zones contentMC
atZone++;
}
}
var zoneArray:Array = new Array();
zoneArray[0] = (Array(0, 0, 250, 250));
zoneArray[1] = (Array(250, 0, 500, 250));
zoneArray[3] = (Array(0, 250, 500, 500));
//trace(zoneArray[0][0]);
makeZones();

Dynamic Length Of Dynamic Of Text Field?
is it possible to set the length of a dynamic text field so that the text flowed into it fits perfectly.
I need this so that I can get the _width of the movie clip it sits in.

help appreciated guys.

Problem With Dynamic Links Attached To Dynamic MC's
My question is a little hard to explain (but I'll do my best) so I have added a link to my source files below for you to look at.

OK, I am working on the logic for a much larger project and I am about 95% of the way there. Basically what I am doing is loading a text file that contains variable information and then breaking that into arrays based on which category the user chooses. Once the user clicks on a category the array for that selection is broken apart and read. It then loads (dynamically) an image (whose name comes from my array) into the "holder" mc, sets it's link to an external HTML page, determines how many sub-buttons (based from the array) are needed and then populates them in their own emptyMovieclips inside another mc called "buttons" and gives each of them a unique link (also generated from the array) that changes the image in the holder "mc". This is where my problem is occurring, for some reason it is assigning the link of the last attached sub-button in the group to all of the other sub-buttons in the "buttons" mc. For the life of me I cannot figure out why, they should each have a unique link. Hopefully some fresh eyes can shed some light on this. Frame 5 is the gut of the code, any help would be greatly appreciated.
Thanks

Here are the source files:
http://www.icandraw.com/source.zip

Making Dynamic Text Field Var, More Dynamic?
i want to do something for the var in a dynamic textfield like:
eval("_root.tfield" + _parent.this_num)

but its not working... is there any way to do something like this?

Dynamic Text Fields In A Dynamic Menu
Anyone can advise how to give names(i.e home,service...) for textfields in a dynamic drop down menu instead of getting the original sequence (ie. text0,text1,text2) or button1,button2,etc...Help please

Dynamic Text Field - Dynamic Size
Hi all

I am trying to do a tooltip that loads a var from database into
a dynamic text field

This I want to customize with a backgrund movie
pls see my illustration!

Because I dont want to have a static size of the background movie
I hope there is a way to make it scale to the textfield


All Ideas welcome

Have a Nice day

Flemming

Dynamic Textbox _y Per Dynamic Line Breaks
I would like to feed variable character lengthed text data to text boxes in my dynamically placed buttons (touch screen kiosk). In my movies i am reading from either xml or db via FSP. I want the text in the text boxes (which label the buttons) to aways be centered in the button graphic, no matter how many lines. I imagine i would set up a conditional and set the _y of the text field per the amount of new line breaks that were dymically created by means of which are still a mystery to me..

Is there a way to achive this without manually adding "
" or whatever your prefered linebreaker is? I've done very similar things, but i've aways had to manually build and associate an array in flash to assure appropriate line breaking. Now i'm dealing with many hundreds of buttons and existing data (such as the strings i would like to label the buttons with)

this is one of, if not the last hurtle for me as far as how dynamic i want my projects to be...! please help!

btw, im using FlashMX

Looping Over Dynamic Variables And Creating Dynamic Mcs
Hello. I have a flash app I'm working on where I'm loading in content from an xml file, then dynamically creating mcs to create an mc for each item in the xml results. Then loading images in to the mcs.

If I don't do a loop and just do it manually, repeating every command but just changing the name of the mcs and variables.. it works.

But when I try to loop over it, its not displaying the mcs. I get no error message. And I've stepped through the code and can't see where its going wrong.

Below is the as for the looping movie that isn't working. If you need me to I can post the as for the non-looping movie if it would help see what I'm doing wrong.


Code:
//---------------------------
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
total = xmlNode.childNodes.length;

for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
}

firstImage();

} else {
content = "file not loaded!";
}
}

xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("fplayer_data.xml");
/////////////////////////////////////

p = 0;
dCounter = 1;
this.onEnterFrame = function() {

for(i=0; i < 4; i++) {
picture0.duplicateMovieClip("picture" + dCounter, dCounter);
this[picture + dCounter]._x = this[picture + i]._x + 55;

filesize = picture0.getBytesTotal();
loaded = picture0.getBytesLoaded();
preloader._visible = true;

if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (this[picture add i]._alpha<100) {
this[picture add i]._alpha += 10;
}
}
dCounter++;
}

};

function firstImage() {

for(j=0; j < 4; j++) {
if (loaded == filesize) {
this[picture add j]._alpha = 0;
this[picture add j].loadMovie(image[j], 1);
this[desc_txt add j].text = description[j];
}
}


}

How To Load Dynamic Text According To Dynamic Image?
Hello all,

I want to make this artist portfolio (ie: a slide show) and I have found a tutorial that showed me how to dynamically load images in an empty movie clip.

Now, I'd like to attach a description for each images and I'd like to keep it dynamic. So, I imagine a folder with one text per image, having a name can can be incremented or decremented (description1.txt, description2.txt, and so on)

and I guess it's a matter of having a recognition of which image we're on in order to load the corresponding text...

Also, I was wondering, can I add html tag in the txt file in order to have some sort of formatting to the output text?

Where do I start?

Thanks

p.

Arrrrrrg Dynamic Objec With Dynamic Variable
I'dont know how to sort this out.
I want to create a new dynamicly named Object and set a dynamicly named variable's value into that object, but i don't know how to trace them (this, eval, idontknowwhatelse,...)

this is a little example


Code:
var objectName:String = "Object_number_0";
var varName:String = "var_name_0";

this[objectName] = new Object();

this[objectName].varName = "Value_number_0";///Here is the problem

trace(Object_number_0.var_name_0);///It should trace "Value_number_0" but it doesn't

stop();
Thanx in advance

Dynamic Text; Dynamic Gradient Fill
Wow. Its been a long time since I asked a question here!

I'm trying to re-create a tweened banner with gradient filled (and broken apart ) text with dynamic text.

I'm using this code inside a loop: aTxt is an array of strings populated from an XML object
code:
var fmtText:TextFormat = new TextFormat();
fmtText.font = "TrajanPro";
fmtText.size = 30;
fmtText.color = 0xE3D280;
// ...
// get the width of the textfields
var txtMetrics:Object = fmtText.getTextExtent(aTxt[i]);

this["mv_"+i].createTextField("txt", 2, 0, 4, txtMetrics.textFieldWidth, txtMetrics.textFieldHeight);
this["mv_"+i].txt.text = aTxt[i].toUpperCase();
this["mv_"+i].txt.setTextFormat(fmtText);

I need to use the TextFormat method because thats the only way i can get the width of the newly created text filed, which I use for some maths later.

Is there any way to use a gradient fill instead of the color 0xE3D280? Or must I make the text as a mask for a gardient fill layer?

Dynamic Buttons For A Dynamic Menu - Flash_8
Hello,

I have to prepare a dynamic menu in actionscript that read the name of the button and the colour from a database in Mysql. I used amfphp to achieve the last part.

I would like to generate the button with the text and its colour get from the database. (The background of the button is gray, there is a little vectorial logo and a text that should be of the given colour, i.e. a gray button with the green logo and the green text, a gray button with the red logo and the red text, and so on).
The rollover should be of the same colour of the text, but the logo and text should become white.

Is it possible to create a movie I could change colour parameters (for text, vectorial logo and rollover)? Or may I create the button from scratch using entirely actionscript? Is there a guide or a tutorial for that?

Thank you in advance for all your help!

[F8] Dynamic Drawing And Dynamic Mask Problems
Hi everyone. I've decided to start learning dynamic drawing (I'm using flash 8) and so I'm attempting to create a basic menu using purely actionscript. What I'm working toward is creating a main button that when pressed, it's sub buttons will drop down from behind it, using a mask to make them show up as they drop down.

I'm still at the initial phase of this. Currently I'm just placing the buttons in their final location so I can work the mask issue, which is where I'm having problems. I've got my script to create the buttons in their proper locations, and then to create the mask in it's proper location. The problem is when I try to apply the mask to the sub-buttons, it also masks the main button. I've tried this several different ways but still have not gotten any success.

Could someone take a look and see what you think? Also, if there is a much easier way to do this, please feel free. Thanks.

Here's my code:

Code:
//Set up some starting variables:
//menu position:
menuxoriginal = 100;
menuyoriginal = 100;
menux = menuxoriginal;
menuy = menuyoriginal;
//menu width and height:
w = 100;
h = 25;
//menu separation:
s = 5;
//corner clip off:
clipoff = h*.25;
//number of menu items:
n = 3;
//
//
//Now create the buttons - no labels on them yet.
//
for (i=1; i<n; i++) {
_root.createEmptyMovieClip("btn"+i, i);
with (_root."btn"+i) {
trace(this);
moveTo(menux, menuy);
//shade first box different color than all others:
if (i==0) {
beginFill(0x222222);
} else {
beginFill(0x3377ff);
}
//draw lines (button)
lineTo(menux+w, menuy);
lineTo(menux+w, menuy+h-clipoff);
lineTo(menux+w-clipoff, menuy+h);
lineTo(menux, menuy+h);
endFill();
}
//prep y location for next button (current y value+button height+separation value)
menuy = menuy+h+s;
}
//
//
//For Testing Purposes: place start of mask halfway over so we can see what's going on. Normally will be the original value of 100.
//
menux = 150;
//reset menuy to be the original value plus the height of the first button.
menuy = menuyoriginal+h;
//create the mask to start at bottom of fist button and cover all remaining buttons:
_root.createEmptyMovieClip("mask", 10);
with (_root.mask) {
moveTo(menux, menuy);
beginFill(0x000000);
lineTo(menux+w-clipoff, menuy);
lineTo(menux+w, menuy-clipoff);
lineTo(menux+w, menuy+5+((i-1)*(h+s)));
lineTo(menux, menuy+5+((i-1)*(h+s)));
endFill();
}
//here make the mask clip mask all the bottons except the first:
for (i=1; i<n; i++) {
_root.btn+i.setMask (_root.mask);
}

Creating Dynamic Buttons With Dynamic Behaviours...
Hi!

I am creating dynamic buttons with a instruccion like this:

Code:
for (i=0; i<25; i++) {

_root['room'+i+'_btn'].onRollOver = function() {

trace ("color:"+i)

};
I want every button says a different number. ej: if u push the button 12 (i=12) it says "color:12"

With the code i created it always says "color:24"

any idea???

Thanks!!

Edit Dynamic Text To Dynamic Textfield
Hey all,

I'm sorry for not having a nice summary!

At this moment I'm working on a project, where the staff has the biggest hate created for anything that looks like a scrollbar. Therefore I'm trying to develop a textblock where texts come slide in from the right. Let's say I've three pages of plain text. This text should be chopped in pieces and placed in an array. Piece 1 becomes page 1 in the textblock, piece 2 becomes page 2 in the textblock which will slide in after a click on a button. Et cetera.

At this moment I've made this with the help op PHP. PHP counts a certain amount of words and devides the text into an array. This array is sent to Flash. The problem: depending on the amount of w's and m's, complete lines will not be displayed or pages will be half full. I'm looking for an alternative here.

The only thing I can come up with is Textfield.maxscroll. With maxscroll I can calculate the number of lines that will not be displayed in the textfield. I'm looking for the possibility to cut off the text after this last word in combination maybe with this maxscroll function. .length counts chars, maxscroll counts the lines, I'm looking for the combination!

Any ideas? Thanks in advance!

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