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




Website - _root. Code Causes Problems



Hi

I am currently building a website that dynamically loads multiple movies into one main .swf file. However in one of my movies i have used the code:

_root.TnF_MC.gotoAndStop(2);

however when this movie dynamically loads into the main swf, the _root. code wont play because it refers to the main swf instead of the dynamic swf.

Is there another way to make the code without using _root?

The code is used in a Movie Clip to control another Movie Clip on the main timeline of the DYNAMIC SWF not the MAIN SWF.

Thanks for any possible help

TedTLogan



FlashKit > Flash Help > Flash General Help
Posted on: 08-20-2005, 03:16 PM


View Complete Forum Thread with Replies

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

Where To Place A _root In This Code?
this is some drag and drop code, after a user has dropped a object i want it to go a diffrent movie clip frame. where would i put my root code?
instead of the nextFrame();

would i put


_root.DO1.gotoAndStop(3);


------------------------------------------------
DRAG DROP CODE

on (press) {
startDrag(getProperty(_x, _y));
}
on (release) {
stopDrag();
if (_droptarget eq "/TA1") {
nextFrame();
} else {
setProperty("", _y, OrgY);
setProperty("", _x, OrgX);
}
}

__________________________________________________ _

THANKS
aIDAN

Add Code To A Frame In A MC From _root
This is not really importand but is it possible? I'm trying to see if I can keep all the code in a file on the root but I'm setting variables and stuff on specific frames within movie clips. Is there anything like:

movieclip.onFrameNumber(number or label){
do something;
}

Cheers,

jr.

Removing _root From Code
I need some help in getting rid of "_root" in this code.

thanks


ActionScript Code:
maxImage = 13;colWidth = 50;rowHeight = 50;colGap = 30;rowGap = 30;cols = 5;rows = 3;counter = 1;initX = 25;initY = 25;for (row = 0; row < rows; row++){    for (col = 0; col < cols; col++)    {        if (counter <= maxImage)        {            _root.createEmptyMovieClip("cont" + counter, 1000 + counter);            _root["cont" + counter].loadMovie("thumbnails/image_" + counter + ".jpg");            _root["cont" + counter].attachMovie("border","border1",1)            _root["cont" + counter]._x = col * (colWidth + colGap) + initX;            _root["cont" + counter]._y = row * (rowHeight + rowGap) + initY;            _root.createEmptyMovieClip("tmp" + counter, 2000 + counter);            _root["tmp" + counter].idx = counter;            _root["tmp" + counter].onEnterFrame = function ()            {                var l = _root["cont" + this.idx].getBytesLoaded();                var t = _root["cont" + this.idx].getBytesTotal();                trace(this.idx + " == " + l + " : " + t);                if ((l >= t) && (l > 1) && (_root["cont" + this.idx]._width > 1))                {                    trace("Fully loaded!!!");                    delete this.onEnterFrame;                    _root["cont" + this.idx].idx = this.idx;                    _root["cont" + this.idx].onPress = function ()                    {                        trace("Pressed ... " + this.idx);                        _root.sel_txt.text = "Selected menu : " + this.idx;                    }                    this.removeMovieClip();                }            }            ++counter;        }    }}

_root. Vs This. - Someone To Check This Code
Hi,

I'm trying to load a jpeg, display a text preloader then fade in the image. I can get the preloader working but when I tack on the call to the fadeIn function at the end all I see is the fade and no preload. What am I doing wrong here?

I've got the following code:

on frame 1

//variables
var series = "p";
var index = 1;
var totalFiles = 22;
loadMovie("../images/"+series+"/image"+index+".jpg", "container");
fadeIn = function () {
if (container._alpha<=100) {
container._alpha += 5;
}
};

same frame different layer

stop();
container._visible = false;
this.onEnterFrame = function ()
{
var l = container.getBytesLoaded();
var t = container.getBytesTotal();
var getPercent = l / t;
loadText = "Photo loading... " + Math.round(getPercent * 100) + "%";
if (l > 0 && l >= t)
{
container._visible = 1;
loadText = "";
container._alpha = 0;
_root.onEnterFrame = fadeIn ;
}
}

ActionScript 3.0 Migration Code For _root.
Hello Friends
I am using AS2 and i have some doubts in AS3.
function zoomer(){
var x:Number = _root.xmouse; //storing some value and using that while movie onenterframe.
}

what is the code in AS3 for that.

_root Code Doesn't Work In Scene 2
I have a preloader that has a progress bar using the following code....

loadedBytes = _root.getBytesLoaded();
totalBytes = _root.getBytesTotal();
if (loadedBytes < totalBytes){
percentageOutput = int((loadedBytes / totalBytes) * 100);
_root.progressBar._xscale = percentageOutput;
gotoAndPlay("preloading_loop");
}
else{
gotoAndPlay("start_movie");
}

This code works great on Scene 1 (the maintimeline), which is what _root refers to...

My question is this, how do I alter this code to make it work in a Scene 2 movie (in the same FLA).

I want to be able to work in ONE FLA file and export separate scenes as swf's that will be loaded into the main timeline (swf). For each of these, I want a progress bar preloader using the above code. It seems the only way I can achieve this is to have separate FLA's for each swf, which I want to avoid if I can. How do I target the Scene 2 stuff (and additional scenes). I can't use _root, I've tried, which means to me that it's exclusive to the maintimeline (Scene 1) in ANY fla file.

Thanks for any help!

Loaded Movie Code (_root.) Not Working
In my main movie i have the code _root.load_movie.loadMovie("images_main.swf");
images_main.swf loads fine but any code in that movie that starts with _root. doesn't work. Do i have to add something before _root. to indicate the main movie?

Help About My Website With My Source Code Plz.
Hi there, I am creating the loading scene now, and wish can let the
instance named "hole" (plz check the hole layer) fading out after "frame number 43"(loading process done), I've been trying lots of way but still can't figure out. Can
someone help me out plz? (I wish I can use AC to solve it cauz I am
practicing it now) Thanks.

The file has two scenes, Loading part is on first scene.

My source code is in below.

Website Filtration Code
I am releasing a game soon and I need to have it protected so that it will only play on a certain URL. The problem is, I'm teaching myself out of a book, and it doesn't give me any information on protecting my material. Can someone give me a few pointers/ commands I can use to check the URL of the site my game is being played on?

Any help is appreciated.

[CS3][AS2] Hello With This 100% Flash Website Code
Hi all,

this has always been haunting me for a while, I mean doing a 100% Flash website, which takes the browser.

I've been able to make the Background take the browsers width and height at 100% using this code


Code:
Stage.align = "TL";
Stage.scaleMode = "noScale";

setProperty(bg_mc, _width, Stage.width);
setProperty(bg_mc, _height, Stage.height);

var resizeListener:Object = new Object();
Stage.addListener(resizeListener);

resizeListener.onResize = function () {
setProperty(bg_mc, _width, Stage.width);
setProperty(bg_mc, _height, Stage.height);
};



For the Bground its ok, but on a layer above the background layer, I have a movieclip (cover_mc) which contains some graphics for a website. What i want to do is

When I resize the broswer, also resize the movieclip cover_mc to fit the users screen and to keep it centered.

I have the Fla Attached as a zip file, can someone please help me wiz it? I going mad with this since i've never made a 100% flash !

Were Do I Get The Stuff Like Movies And How Do I Code It Into My Website
were do i get the stuff like movies and how do i code it into my website

My Website May Be To Small, Resizing It/code?
I'm making a basic website, it looks like it's too small. Will Internet Explorer (or Safari, whatever your default browser) resize the window to fit my site or do I need to code that somewhere in Flash?

If so, how would I go about doing that?

Right now my document is 550 by 400 pixles, which is pretty small now that I look at that. I'm a bit far in the making of the site to resize the stage and reformat everything. What can I do?

If you understand what I'm asking, help me out.

Html Code In Flash Website?
I have recieved some html code to but on my site to display a logo and link for me being a member of the bbb. How do I attach the html code in flash so it shows this logo where I want it? I know it is so easy in html page but not sure how to do this in flash mx.



Thanks

Simple Website Navigation Code?
Hello,

I was wondering if anyone could post up the simple navigation actionscript for creating a website - on release, go to....? ect.

Help appreciated

Thanx!

Need Code Help To Make Website Work
I am using Flash CS3 (ver 9.0)

Any help with this would be greatly appreciated.

I am creating a flash website and have all of the content in one file with multiple layers and separate movie clips inside scene 1. I have a movie clip for the home page, a separate movie clip for about page... and inside each of those movie clips is where my content is for that page.
I have a separate layer for labels, and a separate layer for actions. I am having trouble getting the actionscript to work correctly.

What I want is a preloader (which I already have), then to have the intro/splash page play through, and at the end of the intro/splash page I want it to automatically go to the home page and stay there until the user clicks on one of the buttons to go to another page.

My labels are "introPage", "homePage", "about"...

My preloader code is: (even though it gives me a warning that _totalframes is no longer supported)
if (this._framesloaded >= this._totalframes) {
this.gotoAndPlay("introPage");
}

In the second frame in my actions layer I have the code:
this.gotoAndPlay("introPage");

Actionscript for "introPage" is:
stop();

Actionscript for "homePage" is:
stop();

this.home_btn.onRelease = function() {
this._parent.gotoAndStop("homePage");
}

this.about_btn.onRelease = function() {
this._parent.gotoAndStop("about");
}

With the code given above the whole website just blinks really fast showing the content for only a second and then starts running through the whole cycle the same way again.

If I remove the above code for the "homePage", except for the stop(); everything works fine until it's time to enter the home page which it does not do.

Please let me know what I'm doing wrong with my code. And I know from reading other posts that it's better to have separate swfs for each page but I'm not sure how I would link them later if I did it that way.

Thank you,
ar

How To Best Structure/code A Website Or Presentation
I'm trying to figure out what is the best way to structure a simple interactive presentation in Flash - I only got a few months programming experience.
Mine is as such:

home_mc // contains buttons hbtn1_mc
page1_mc

I have labeled frames on and off to allow for animation of pages elements.
And in the root timeline the actionscript is as such:

this.onLoad = function () {
this.home_mc.gotoAndStop("on");}

this.home_mc.hbtn1_mc.onRelease = function () {
this.p1_mc.gotoAndStop("on");
this.home_mc.gotoAndStop("off");
}

But it doesn't work! Can you offer any ideas suggestions, or your way to structure this sort of project?

Flash Website Source Code
Hello everyone,

I am looking for the source code of an advanced flash website to reference. I know AS3 and how to use flash, but I have never made an advanced flash website. I would like to make one, but I do not know how to layout everything and where to put the code (on the timeline vs. external).

It would be helpful if I could look at the .fla file of a flash website just to see how everything is put together. Does anybody have any ideas or links to a .fla file?

Thanks,
badfish

URGENT: Help Needed With Flash Website, Code Provided
Hey guys,

I need some help urgently, I've got a portfolio presentation to do here in a few days and I need to get this fixed! I believe it is a fairly simple problem.

Anyways, the problem is that I have a flash website, named main.fla. Inside main.fla there is code to load an external .html and .php file so that it can grab all the variables and replace the text on the website. The code looks like this:
Code:
Stage.align = "TC";
Stage.scaleMode = "noScale";
url = "xxxxx";
loadVariablesNum(url+"_main.html", 0);

_root.emp.useHandCursor = 0;
stop();
the URL is called for two files, the XXXXX_Gallery.PHP and the XXXXX_main.html

Now this all works when it's in my regular directory on my hard drive. However, when I upload it to my web server, and open up the main.html, it does not not display the text at all that is supposed to be replaced on the flash file from the XXXXX-main.html where all of the variables are stored.

Is this some sort of pathing problem? It sure seems like it. If so, how would one fix this?

Thanks for any help, I really appreciate it!

Flashmx-Im Trying To Make It So That When _root.lazer Collides With _root.bad It Goto
Im trying to make it so that when _root.lazer collides with _root.bad it gotoandplays("Explode"); im using this script

onClipEvent (load) {
if (this.lazer(_root.bad)) {
this.gotoandplay("Explode");

My fla is attached.

_root.play() / _root.gotoAndPlay() Not Working
Hi,

I am working on an interactive movie, the movie consists of a number of small movie clips. I need each clip to play and when it reaches it’s end stop and tell the main time line to move to next frame, on that frame the next MC will [play and do the same.

I am trying to use this script for the last frame of the movie:


_root.play()

I also tried “_root.gotoAndPlay()” and “_root.nextFrame()

It doesn’t seem to work.
Anyone has any idea why ???

? -- TellTarget(_root.man_0 && _root.man_1) { -- ?
Can you tellTarget multiple targets?

Loading .swf To _root And Performing Actions On _root
Hello, I have a loader which should load a movie which should be placed on the _root so that all of it's actions will still work. also, i need to perform some actions on the _root which is specified in my loader. f.eks. say I load my movie at _level0 and then I trace "movieLoaded" all the time.

And I use flash MX

This _root And That _root, Parents, Children, LoadMovie...
I'm building a showcase to show a bunch of my work. Let's call my work "children" and the showcase file the "parent".

A lot of the children files have some actionscript that references functions and variables on the root level. However, when those files are loaded into the parent file, the root is now the root of the parent file, not the child file.

SOME of the stuff, I've been able to remedy by opening each flash file and copying and pasting all that crud into the shell flash movie.

Unfortunately, not all of my wizardry is working, and hey, who knows what's wrong. Since the individual files each have functionality that works on it's own, is there some way of telling those children files to look at the root ONLY on their own file, or, as soon as the swf is loaded, the root is changed?

How can I avoid this in the future?

ALSO, is there some way to globally override the "getURL" function call so any and all clicks are now dead links?

_root.xyzxyz What This _root Means?
What is the meaning of _root. What does it represent.

_root.link / _root.page Help
hi gang, ive got a flash template im trying to edit for a friend, id say im fairly good at flash ive made alot of sites with actions but having trouble with this.

the problem i have got is the _root.link=

this is the action script:
on (release) {
if (_root.link <> 8) {
_root["page"+_root.page].gotoAndPlay("w2");
_root.link = 8;
_root.page = _root.link;

}
}


(there was more but that was just controling the button animation, ive just posted this to keep it simple , for me atleast)


what im having trouble doing is working out where the route is?
i want to be able to creat another movie and link it

eg:

on (release) {
if (_root.link <> 9) {
_root["page"+_root.page].gotoAndPlay("w2");
_root.link = 9;
_root.page = _root.link;

}
}


how would i lable the movie to be '9' where would i do this, i have looked and ive had no joy, some help would be good, if u need more info from me please do ask

_root._root[eelmine].nextFrame(); ?
if a condition is true, then:
_root.(MC with instance name that is the value of "_root.eelmine").nextFrame();

is this correct?

_root._root[eelmine].nextFrame();

_root._root[eelmine].nextFrame(); ?
if a condition is true, then:
_root.(MC with instance name that is the value of "_root.eelmine").nextFrame();

is this correct?

_root._root[eelmine].nextFrame();

_root._root.testbox?
I have this small problem.
I have 2 swfs(main.swf and links.swf)

I then load links into main. In links I loadvar using php and sql.
I fetch links from my sql databas and print it in php.
But it doesnt work when I load links into main.
It only works when I view links.swf directly.

Example:
links.php

databas connection etc etc
mysql query etc etc
print"&name=$name";
print"&link=$link";
print"&status=DONE";

in flash(links.swf)i then have this:
status = "LOADING";
loadVariablesNum("links.php", 0, "POST");
if (status eq "LOADING") {
gotoAndPlay (_currentframe-1);
} else {
gotoAndPlay (2);
}

I have 3 dynamic boxes called:name,link and status.

and a stop() on frame 2.

So how do I get this to work? I´m sure you guys know the answer to this.

I also have another question.
When I look at the links.swf directly only the first post appears and I want the whole list so that the user/visitor can scroll the link list. How do I loop that in flash or is it in php/sql It should be done and if so,, how would the php code look like.
Would this work?
$query="select * from links";
$result=mysql_query($query);
$name=mysql_result($result,"name");
$name=mysql_result($result,"link");
print"&name=$name";
print"&url=$link";
print"&status=DONE";

How do I then make the name linkable?
I can only have one dynamic box in the flash right?
So that the name flashkit is the link to flashkit.

Please help me with the above,, really need to get this to work.

Searchable Website Vs Slick Website...when To Draw The Line
Just curious what everyone thinks here:

So, we all know how search engines have a hard time reading flash sites. Well, I have come to a road block in my designing...I have clients that want their sites in the search engines but also want a certain amount of 'tech' to them! I can design pages with 'some' flash, enough to make it interesting, BUT if they want a 'fully searchable' page, what do we do?
I can type html all day long but it will never compare to the slickness of flash. I just finished my first 'full html' site in over a year(stuck on flash) and I am blown away by the clarity! It makes flash sharpness look dull! (sorry)

**My Question:
If you had a client that wanted a high tech site and also wanted to be 'searchable', what would you do??

***I'd like to hear all opinions, reasons and answers***

Mike

_root._parent.? Problem With "_root" Etc
I have been using flash for some time now and understand basic actionscript. However only just recently(last few days), i have gone onto more advanced stuff like cursors (advanced for me )

Well i am making a flash movie that incorporates all of my testings for people to see.

I am current;y working on a movie where the cursor is a knife, and when the cursor goes over this picture of someone, the knife (cursor) should go to and play the second frame of the knife (cursor) which has added blood.

I.e, when the mouse goes over the picture, the knife becomes a picture with blood, so in effect you are stabbing the picture. (don't worry, i'm not a sadist!)

At the moment my movie is like this...

drag drag2
(pic) (knife)
^ ^
| |
<<drag_mc>>
^
|
Scene 1 -----> navigation...
(root?)

Description: The scene one has two movies in it, "navigation" (which is OK) and the "drag_mc". The "navigation" is fine so i won't go into that. The "drag_mc", then has two movie clips in it, "drag" and "drag2".

I assume that to make the "drag2"(cursor) go to frame 2 when it hovers over "drag"(picture) that the "drag" should have a on(rollover)
command. I've put in the command, but i'm having troubles linking that to the "drag"'s frame 2.
I have just messed about with _parent and stuff, but never understood it.

Please could someone help me here, and/or tell me exactly how the _root and stuff works??


P.S. the on (rollover) is actionscript for the drag movie, and not in the movie if you get what i mean....



---newbie in distress---

EDIT: the picture did not come out as planned, but it is still readable. Just remember that the two movies ("drag" and "drag2") are placed in the "drag_mc" movie

A Button In A MC In Frame 1 Of _root Hiding An MC In Frame 2 Of _root?
Hi. I have a button, "auroraB" in a movie clip "startupMC" which is in frame 1 of _root. There is another MC, "scenic" in frame 2 of _root.

The button "auroraB" is clicked and takes the user to frame 79 of the MC in frame 1. From there the user clicks another button to go to frame 2 of the _root.

How do I get it to hide MC "scenic" in frame 2 of _root when the button "aurroraB" is clicked? Thanks

_root.send1.text = _root.total3.text;
Ok I have this script in a Movie Clip! First frame has

_root.send1.text = _root.total3.text;

2nd frame
gotoAndPlay(1);

So it updates!

Both send1.text and total3.text are input text fields in Flash! When I test this out it works fine but when I get it up online it doesn't work! The information in total3.text doesn't get sent to send1.text!! Also note both have Var titles asigned to them! Let me know if you can figure out what's wrong! Thanks!

Convert "_root" To _root
anyone know how to convert a string "_root" to the path specifier _root???
The Object() converstion function doesn't seem to be doing the trick..
hmmm
any help would be appreciated
cheers

If (this._url = _root._url && _root:leiaSala) {
SORRY ABOUT MY ENGLISH!

WHAT MEANS THIS LINE

if (this._url != _root._url && _root:leiaSala) {

IN SPECIAL THE :

I'M NEED TO EXPORT SWF IN AS 2.0, AND THIS "OPERATOR" IS DEPRECATED.

THANKS

[F8] From Text "_root.home.score" To Variable _root.home.score ?
Hej

How can i convert this string "_root.home.score" to a varialbe, so i can use it for actionscripting

"_root.MCname" + "_root.MCvalue"
Hallo,
how can I grab the value contained within a MC name, e.g.:


Code:
duplicateMovieclip(_root.myMC, "_root.myMC"+someIntegerVariable, level);
_root.myMC+someIntegerVariable._x = 100;
It happens that the parser cannot parse the second row, since
"Left side of assignment operator must be variable or property".

My target is to make the sum of two instance names as a single instance name.

thank you very much!
s---

[F8] Loading And Unloading External SWF Code Issues, Code Check Please
Okay, I'm still clumsy with AS and I'm having problems loading and unloading external SWFs. I have SWFs created by others in Captivate that need to be controlled by a main menu. I created the menu and buttons and have been trying to code it so that with the button click, the appropriate external SWF loads in an empty movie clip, plays, and then closes at the final frame and returns to the menu. So far, I can get it to load, but then I'm stuck as I'm not sure what I'm missing as far as it reading the frame numbers.

Here's the code I've written. I can't seem to get my idea for the onEnterFrame function checking the frames to work.

What am I missing? Can anyone offer any suggestions or guidance? Thanks!


Code:
this.createEmptyMovieClip("clip1", 1);

myfirst_btn.onRelease = function() {
clip1.loadMovie("externalswf1.swf");
}

mysecond_btn.onRelease = function() {
clip1.loadMovie("externalswf2.swf");
}

mythird_btn.onRelease = function() {
clip1.loadMovie("externalswf3.swf");
}

clip1.onEnterFrame = function() {
if (clip1._currentframe == clip1._totalframes) {
// remove move clip1 and return to menu
clip1.removeMovieClip();
}
}

External SWFs, Code Works But Not With Additional Code
I'm using a loadMovie code that works perfect by itself, but when I add additional code to the button, it doesn't work.

Here's the scenario:

I have an MC named songs In this MC I have several buttons that should each perform very similar actions.

The first action is a:

gotoAndPlay("somewhere"); action that takes the movie to a specific frame of this MC. This code by itself works fine.

The second action I need to happen is:

this.contents.loadMovie("music1.swf") which loads an external SWF which is nothing more than an MC with an audio clip. This code, by itself works fine.

The problem comes when I combine the two codes to create:

on (release)
{
gotoAndPlay("somewhere");
this.contents.loadMovie("music1.swf");
}

The movie does go to the "somewhere" frame, but the external SWF no longer loads.

I have tried it with _root.songs.contents.loadMovie("music1.swf");

I have tried placing the loadMovie code first, but neither of those solutions work.

Any ideas?

Thanks

Help> How To Remove Part Of The Code Without Breaking The Entire Code
I use the following code on my website (http://www.misenplace.com.br ), it`s a fading out script that shows a banner underneath it.

I want to remove the pagetitle, welcome, date and sitename, but I can`t figure it out since when I remove something the movie doesn`t load or it doesn`t fade out as it was supposed to.

here`s the code


Quote:




var imgLoader = new MovieClipLoader();
var mindepth = welcome_txt.getDepth();
mindepth = mindepth < pagetitle_txt.getDepth() ? (mindepth) : (pagetitle_txt.getDepth());
mindepth = mindepth < date_txt.getDepth() ? (mindepth) : (date_txt.getDepth());
mindepth = mindepth < sitename_txt.getDepth() ? (mindepth) : (sitename_txt.getDepth());
var maxdepth = welcome_txt.getDepth();
maxdepth = maxdepth > pagetitle_txt.getDepth() ? (maxdepth) : (pagetitle_txt.getDepth());
maxdepth = maxdepth > date_txt.getDepth() ? (maxdepth) : (date_txt.getDepth());
maxdepth = maxdepth > sitename_txt.getDepth() ? (maxdepth) : (sitename_txt.getDepth());
this.createEmptyMovieClip("imageHolder_mc", mindepth - 1);
imageHolder_mc._x = 0;
imageHolder_mc._y = 0;
imageHolder_mc._alpha = 0;
imageHolder_mc.duplicateMovieClip("imageMasker_mc" , maxdepth + 1);
imageMasker_mc._alpha = 0;
imgLoader.loadClip(imageName, imageHolder_mc);
imgLoader.loadClip(imageName, imageMasker_mc);
welcome_txt.text = themessage;
welcome_txt._visible = false;
welcome_txt.autoSize = true;
var sitename_str = pagetitle;
var pagetitle_str = "";
var pos = sitename_str.indexOf(" - ");
if (pos > 0)
{
pagetitle_str = sitename_str.substr(pos + 3);
sitename_str = sitename_str.substr(0, pos);
} // end if
pagetitle_txt.text = pagetitle_str;
pagetitle_txt._visible = false;
pagetitle_txt.autoSize = true;
sitename_txt.text = sitename_str;
sitename_txt._visible = false;
sitename_txt.autoSize = true;
var curdate = new Date();
var date_str = curdate.toString();
var pos = date_str.indexOf(":");
var datestr = date_str.substr(0, pos - 3);
datestr = datestr + (", " + date_str.substr(date_str.length - 4));
date_txt.text = datestr;
date_txt._visible = false;
date_txt.autoSize = true;
imgLoader.onLoadComplete = function (targetMC)
{
_root.onEnterFrame = function ()
{
if (imageHolder_mc._alpha < 100)
{
imageHolder_mc._alpha = imageHolder_mc._alpha + 3;
}
else
{
if (!welcome_txt._visible)
{
welcome_txt._visible = true;
pagetitle_txt._visible = true;
sitename_txt._visible = true;
date_txt._visible = true;
imageMasker_mc._alpha = 100;
} // end if
imageMasker_mc._alpha = imageMasker_mc._alpha - 3;
if (imageMasker_mc._alpha <= 0)
{
delete _root["onEnterFrame"];
} // end if
} // end if
};
};






thanks a lot everyone

Movieclip Code Interacting With Document Class Code
I'm coding an application in Flash CS3 but relying heavily on doing most of the heavy lifting in actionscript3. I've set a document class (i.e. package me.mine{ class Main extends Sprite(){} }) with most of the code necessary.

In my Library I've got a Movie Clip for a control panel. I instantiate the movie clip from the Main class. This movie clip will change itself around (an off state and an on state with different menu options) - and i want to be able to add a button within the clip, and when it's clicked, have it call out to a function in the the Main class.

But I can't figure out how to get the MovieClip to talk to the Main class (I can set event listeners from the Main class on elements in the clip, but the clip will change around so I want it to work in the other direction).

Thanks for your help!

How Do I Execute Code Then Move To Another Frame When Code Is Finished And Run More?
hello. im well new to flash and im tring to build a cool flash movie using MC Tween in action script. my problem is i want to execute soem code then whenits finisd move on to frame 5 which has more code in it and then execute that code and so on how do i achieve this.
thanks

Code - What Code? You Didn't Spend Hours Writing It.
Hello,

Has anyone had a problem where sometimes (for no apparent reason) flash doesn't retain your code after you save and quit and then reopen the fla?

I used to think this was happening due to my backup app., but it's not running anymore. I even saved an additional copy of the file on my desktop AND dragged another copy to another folder. Everything was missing the same code.

We I published the swf before exiting, it worked perfectly.

Any ideas for fixes? Running os 10.3. Tried getting rid of prefs - no luck.

This is getting annoying. Happens with every fla I'm editing.

Thanks,
Ward

Newbie Convert Button Code To Frame Code
Hi all!

I guess this is a really simple one.

I have a button with the following code attached to it:


PHP Code:



this.onRelease = function() {    SWFAddress.setValue('/portfolio/');}this.onRollOver = function() {    SWFAddress.setStatus('/portfolio/');}this.onRollOut = function() {    SWFAddress.resetStatus();} 




I want to use this code on a frame. Is it onLoad I need to use??

Object/embed Code Missing From Source Code
I have the wackiest problem.. its killing me. I developed a simple flash banner for a client. It works fine on 99% of all machines, but the client's machine happens to be in the 1% that it DOES NOT work on. When he pulls up the page containing the flash file, he gets nothing. He has the latest flash plugin, and can view other flash content. When I view the source code on the machine that is having the problem, all the code is there EXCEPT the object/embed code. Its just missing. What in the world could cause that? I checked for firewall issues. He is running norton firewall. I disabled it, but he still has the problem.

This is the page in question:
http://projects.newtarget.net/RELOconnections/flashtest.html

as you can see, nothing special. simple flash, simple code. the other computers in his office have no trouble, its just his computer and his parents computers. I tried the page in IE 6 and firefox. Same result, he is not getting the flash code. He's on WinXP.

Can anybody think of ANY reason why he would be being shielded from getting object/embed flash code?

-vb

My Code Has No Friends: The Story Of My Sucky Code
I have an text input. I want it so that when you hit enter, it'll do stuff.

I want one of the commands to be...

goto

...however, here's the issue:



onClipEvent (enterFrame) {
pressed = Key.getCode();
pinputinn = pinput.toLowerCase();
if ((pinputinn == "goto") and (pressed == 13)) {
gotoAndStop (2);
}
}


Could someone tell me why that doesn't work, and what would work?
[Edited by Crickett on 07-20-2001 at 11:17 PM]

No Flash And No Embed Code In Source Code?
I really dont know whats going on here, when i try to embed my flash into a html or php document the flash movie does not appear when browsing, when i view source the code is not even there but all other code changes are reflected (i know the document has been updated). When i go direct to the swf url I can see the file. when i publish the swf with html it works fine locally but again online i cant even see the code. other flash files work fine on my site, this is a problem on IE and firefox.. whats going on???????

[F8] Help. Integrate Cpu Check Code With Preloader Code
Hi, guys!

I was looking for a way to do a cpu check over the user´s computer and then, based on the user´s cpu speed, redirect his browser towards one of two different versions of the same flash movie (let´s say, a "light" one without effects and a "full" one with all the effects). I´ve already got a fine working preloader, and I´ve found a nice cpu check code here in this forum. The problem now is that I am not able to put them together. Something like, after a mouseclick, perform the cpu check and after that load a movie based on the previous cpu check...

I am posting my fla and the original cpu check fla that I´ve found here to show what I´ve got so far.

Thanks in advance!

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