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




How To Target Scenes In Code



i have a preloader but i want it to preload a scene how do i get the bytesloaded and bytestotal of scene2 from code in scene one?



ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 01-30-2007, 02:47 AM


View Complete Forum Thread with Replies

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

Target Paths Between Scenes...?
here it goes: i want to make a a button contained in one movieclip take me to a certain frame of another movieclip that is placed in another scene... i just cant figure it out...

i think the problem is the targeted mc being placed on another scene... i wrote this actionscript:

on (release) {
_root.movieclipname.gotoAndPlay("scene name", "frame label");
}

but it wont work...so if anybody has been through this and wants to help me out, i will really appreciate it.

thanks a lot...later.

Best Way To Target Scenes/swfs
Just wondering before I go any further into building my flash site, what's is the best way to link the scenes/swf files to one another using the menu buttons? Here's my current scenario:

I placed code on the buttons via the 'gotourl' action and that is what I currently have on my site: www.sassandperil.com it works fine....but then the next chapter in a tutorial book told me to make frame lables on the menu's movie clip then assign the 'loadMovNum' feature to pull up each indivual swf file. So I went back in the original website file and saved each scene as a swf file appropriately labeled, home, portfolio...etc. Then used the 'loadMovieNum' feature on the first keyframe of each frame label to load the movies. But this isn't working out very well for me because my menu disappears a second or two after the test movie loads. It's still there b/c I can click on it, it appears momentarily, and then takes me to the desired next section, but disappears again when I get to that page. Now I'm utterly confused and it's hindering my progress!

Should I scrap this method of targeting my pages via frame labeling on the menu's movie clip and just stick to the 'gotourl' method? Problem is I need to add subcategories and content and I don't want to go any further until I clean up this mess!
Any help would be appreciated, thanks
~SLK

Multiple Scenes And Target Paths
Heya,

not sure if this is proper forum for this, but i'll give it a shot anyways. i've got a project that has alot of actionscript and looping (gotoAndStop type stuff). now, it was working great until i tried to add an additional scene and have it play prior to my first scene (a preloader). now it appears that the second scene has just been added to the front of the first scene, and if i do a "gotoAndStop" command referencing the frame number, it is not going to the proper frame. it is as if i have another 3 frames (the size of the pre-loader scene) at the front of my timeline.

can anyone confirm this for me? is there any work arounds, or do i simply have to go back and account for the 3 extra frames?

thanks in advance

PoTs

How To Target Movie Scenes From A GIF With An HTML Page.
I have a client wanting to set GIF images to not only link back to a page that has an embedded flash movie, but to also get the flash movie to movie to the 3rd scene of that movie. The movie will have all ready been cached because users have to go through the initial flash presentation before getting the option to click on said link.

Is this possible and does anyone have a resource that would give me an example.

Thanks

What Happens To Scenes/code In A .swf?
Hello:

When a swf is published do all scenes get added to one continuous timeline with the goto ..s etc. being correctly pointed to the new place?

My main reason for asking is that I am working on a project that will include 12 games that are somewhat similar. If I name the functions the same in each game would that eventually cause problems in the final .exe. I tend to write all AS2 code in SEPY and use include as I find this easier than the Flash 2004 MX (non-pro) script editor. If I can use the same functions then all I need to do is to add those includes in the right scenes.

Any advice, or pointers in how Flash is eventually interpreted would be appreciated.
TIA,
Indoda

Is It Possible To Target Code?
Hi,
Just curious. Would it be possible in actionscript to target a portion of code? ex... Have a MC with a fade in and fade out script on the same MC, telling it when to fade in or out by targeting the code itself? I don't believe this can be done. Just curious.

Regards
~GD~

Help With Target Code Please ...
Hi there,

This is the short version:

Movie1 is blank stage to load other movies.
Movie2 has buttons which can load movies into Movie 1 (Got this working)
But movie 2 has it's own mc with buttons, I can't get these buttons to load movies into movie1

The long version:

I have a flash site I'm building with the following format:

Mainstage Movie.swf (Loads)
-----> Opening.swf
------>Section2.swf
------->Section3.swf etc...

Mainstage is blank while "Opening" is actually the main page (not great logic in hindsight but too late now)

The opening movie has all the buttons that load the other movies.

Here is where I'm stuck, I have a button that is also a movie clip inside that movie clip are more buttons which appear as the user mouseovers... I can't get these buttons to load any of the swf's into the mainstage movie.

All the other buttons in the opening movie work except the ones inside another movie... I realise it's to do with targets but I can't figure it out...

Here is what I currently have:

on (release) {
loadMovie("editorial.swf","_level2");
gotoAndStop("content");
}

Code For Playing Random Scenes
i made an interface where when you press a button, i would like it to play random scene. I have 34 scenes, the first being the starting point (where the button is clicked) and i want it to play 2-34 randomly. i named them "scene1, scene2..." and so on. do i have to declare the specific names of those scenes (make an array) and then call them in the code?

i tried making a variable that uses the random() command ("scene"+variable,1), but anything in the area specifying the scene you want to play has to be quotes as we all know, so it doesn't recognize something in that region that isn't, and it just plays the scene name that is specified in the quotes.

stressing here...any help would be appreciated. let me know if you need more info.

thanks guys!!!
saxw

Using Scenes Stopping Code From Working?
Hi i have made a simple pong game for my website, the game works fine until i put a scene in front of it! There are 2 sides and a top which bounce the ball off, and one at the bottom so if the ball touches it it removes the movie clip and takes you to the game over frame.

However like i have said for some strange reason when i put a scene in before the game, it seems to be stopping this part of the code from working?


Code:
onClipEvent (enterFrame) {
if (this.hitTest(_root.bal)) {
removeMovieClip(_root.bal);
gotoAndPlay(4);
}
}
I have also tried using a container movie to load it into and it still does the same?

Any ideas are most appreciated

Just incase anyone has time to actually look at the source file i have uploaded it to

http://www.yamahaclub.com/pongtest.zip

Its only 48k

Thanks Again
Alex

Button Code To Change Scenes
Ok so I am stcuk on a basic... trying to move from scene to scene through buttons. In my code I have:

on (release) {
gotoAndPlay("home", 1);
}

and four other buttons relatng to the scene (or web page as it is a website). I have given the button an instance name on its scene as well.
Do I put this code on each button on each scene?
And how do I get the buttons to work - there must be somewhere that I need to put more code in?
PLease, please....I know its basic, but so hard to get past and I'm soooo tired..... searching searching...
Fio

Button Code To Change Scenes
Ok so I am stcuk on a basic... trying to move from scene to scene through buttons. In my code I have:

on (release) {
gotoAndPlay("home", 1);
}

and four other buttons relatng to the scene (or web page as it is a website). I have given the button an instance name on its scene as well.
Do I put this code on each button on each scene?
And how do I get the buttons to work - there must be somewhere that I need to put more code in?
PLease, please....I know its basic, but so hard to get past and I'm soooo tired..... searching searching...
Fio

'Tell Target' <--deprecated Code?
yesterday, i read in a post that functions like 'tell target' will be removed from future verions of flash because they are deprecated. now, my question is what is the new way to code 'tell target' functionality? what has replaced 'tell target'? - i use it a lot, and want to make sure i am using what is best, not just what i'm used to...

thanks, nords

Cannot Target Code Defined In Another Swf.
Hi there,

I've been debugging for the last couple of hours but cannot get it worked out...

The situation:
One parent movie p swf that loads two seperate submovie swfs a & b.
After everything has fully loaded I want that submovie b calls some code thats defined in submovie a.

So we have parent movie p, submovie a, submovie b

p---a
|___b

Inside b.swf there's some scriptcode that says:
_root.a.somecode();

The function is never triggered.
Also very awkward is that when I trace(_root.a) inside b, i get nothing, not even 'undefined' or something?

I have to note that all the movie names are defined on frame1 so they all exist when I try to call the code.

Does this sort of problem ring a bell by someone?

greetz,
David van Zeventer

Target Code Problem
hey all, i found a menu here on flashkit about 2 years ago and just got around to actually using it. however, when modifying the frame targets nothing work right.

to see what i mean go to: http://www.olympicsoccerclub.net and click on the philosophy and "general forms" under registration.

i have included the .fla on my server for you to take a look at. all my frane names and coding check out right to me, so i have no clue what i'm doing wrong. any help would make my week.

download the .fla here: http://www.itypical.com/john/menu.zip (Flash MX)

to access the actual code, if right click on the box with the question mark and click edit, and open up the first keyframe's actions you'll see the coding.

Target Timeline Code
Hey guys I was wondering if somebody can help me with some
actionscript/timeline questions I had. Lets say I have three SWF files: A, B, and C. File A is the "Master" document and loads file B. File B then loads file C. File C calls a function that I have on the timeline in file B. Here is a sample of the code I am using in file C to access the function in file B:

this.mcGeorgiaThumb.onPress = function() {
_root.loadGallery("/Pics/GeorgiaVacation");
}

This will work perfectly fine when testing from file B. That is, when file B is not loaded by file A. The "loadGallery" function which is in file B gets fired. But when I use file A to load file B (which consequently loads C), the "loadGallery" function does not seem to fire. I suspect that it has something to do with how I am accessing the code on this timeline (i.e the "_root" keyword). Am I doing this correctly?

How Can Loadmovie - Target Influenciate Code?
Hi,

I'm trying to load external swfs to my main file.
They are action games and only work when I load the swfs using level.
The problem is that they do not load in the right spot.
When I load into a holder it shows the first few frames but the game does not play.

How does the loadmovie changes using target - holder x level?
Is it better to load in a level and try to locate the swf with code?

Could you give me a hand with this?

Here's my code:
code: on (rollOver) {
tellTarget ("/indicator") {
gotoAndPlay("pre1");
}
}
on (rollOut) {
tellTarget ("/indicator") {
gotoAndStop("None2");
}
}
on (release) {
unloadMovie("theClip");
loadMovieNum("em_ge_act1.swf", 6);
}

or

code: on (rollOver) {
tellTarget ("/indicator") {
gotoAndPlay("pre2");
}
}
on (rollOut) {
tellTarget ("/indicator") {
gotoAndStop("None2");
}
}
on (release) {
unloadMovie("theClip");
loadMovie("em_ge_act2.swf", "theClip");
}

[F8] Multiple Target Areas..code Within.
function makeDup() {
var myMC = this.duplicateMovieClip(this._name + this.num, ++depth);
myMC.num = this.num++;
myMC.startDrag();
myMC.onMouseUp = function() {
stopDrag();
myMC.onPress = doDrag;
delete this.onMouseUp;
if (!this.hitTest(greenRect)) {
this.removeMovieClip();
}
};
}
function doDrag() {
this.swapDepths(++depth);
this.startDrag();
this.onMouseUp = function() {
delete this.onMouseUp;
stopDrag();
if (!this.hitTest(greenRect)) {
this.removeMovieClip();
}
};
}

Hi this code is used to duplicate movieClips when one is pressed yet only allows for the duplicate to be placed on a targer MC,"greenRect, how can i add more target areas to this code. i now have greenRect_1, greenRect_2, etc etc but i am unable to add these to the code, i have tried adding them inside the hitTest rackets seperated by commas, however this did not work, do i need to add an else if part to allow for more than 1 target area? Please help flashkitters.

Snapping A Movieclip To A Target Can Someone Review My Code
I am using this code in one movieclip to snap one object to another - is this correct? Lev1 is the name of the target object, (both objects are movieclips):
 Actionscript:
on(press) {
        this.x = this._x;
        this.y = this._y;
        startDrag(this);
        _root.answer1="";
}

on(release) {
        stopDrag();
        if (eval(this._droptarget) == lev1) {
                this._x = lev1._x;
                this._y = lev1._y;
                _root.answer1="Correct";
                _root.allCorrect +=1;
        } else {
                this._x = this.x;
                this._y = this.y;
                _root.answer1 = "Sorry, try again";
        }
}

Need Code For Random Scenes Not Random Movies
Hi

I need a code for loading random scenes for a flash intro. I have only found a code for loading random movies but I don't want to have to do the preloader for every movies because it would destroy the whole thing on how it loads.
Any help is appreciated.
Thanks!!

Exporting Scenes Separately And/or Importing Scenes From Other Files
does anyone know a way to import a scene from one file to another or a way to export/publish scenes separately (make each scene a different file)

thanks

Newbie Movement Question - Move Number Of Pixels NOT To Target Or Even PRECISE TARGET
Like a lot of people im using the code below to move a movie clip my question is this - how do i move the clip exactly a set number of pixels from its current position (lets say 20 pixels) rather than setting a target?

(what im using now)

onClipEvent (enterFrame) {
if (_root.go==1 && root._x<300) {
_x = _x+2;
}
}

ive tried lots of things but there must be a simply answer - someone please help.. thanks.

My second question is how do i move something to a specific x target ie not use <300 or such like - ive tried != and stuff like that but to no avail..

1st question more important right now though - thanks!

Apply Glow Filter On Target MC While Dragging An Object And Rolling Over The Target
I can get my filter to apply to a movie clip if i simply rollover or roll out of it. When the mouse rolls out, the filter is set to undefined. The problem I am having is that I want the object that is in effect the hit area to glow (have a filter applied) when the draggable object is being dragged over it.

This would make is easier for the user to visually identify that where they are currently hovering over, whilst dragging, is the area that they should drop the object.

Part of my code looks like this


Code:
this.onRollOver = function () {
if(_global.isDragging == 1){
this.filters = glowFilterArray;
}
}



this.onRollOut = function () {
_global.isDragging = 0;
this.filters = undefined;
}
_global.isDragging is set to 1 at the onPress stage, when startDrag occurs.
_global.isDraggin is set to 0 onRelease of the draggable object.

Are there any ideas for a solution?

Sound Across Scenes & Changing Volume In Certain Scenes..
OK, this is kind of hard for me to explain but i'll try...

I want to have a continuous sound loop over various scenes, but I want the volume to increase (i.e. fade up - and i would like it to fade rather than just suddenly turn up) during one of the scenes.. and decrease (i.e. fade out) to 0 during another scene.

On top of that, I'd like the sound loop to stop altogether when they play another audio file on the movie - then the loop resume when they return to scene 1.

Anyone able to help me here - i know it's sounds complicated but I am sure someone knows how i can do this.

Any help would be much appreciated,

thanks,
Chris

Action On Button, Tell Target, Error=target Not Found
Hello, beings of helpfulness!

I am working at a non-profit and trying to make a website from a Flash template with minimal, but some Flash experience. The template has multiple timelines (main page, content pages, and buttons). This part I am still learning. On the home page, I have an image (mc) that loads, with an instance name of "girls." Menu buttons take the viewer to corresponding content pages, which is when I want the image on the main page to dissapear to make room for the content. When the viewer selects the home page again, I want the image to appear again. At first I put in the following action (except for the home page), alpha=0. It worked! And now it doesn't! I did play with the button timelines some. I tried taking the actionscript out and putting it in again, to no avail.

The action in my button is


on (release) {
tellTarget ("_root.girls") {
_alpha=0;
gotoAndPlay(11);
}
}

And the error I now get is: Target not found: Target="_root.girls" Base="_level0.instance58.instance543"

Any ideas? I'm quite stuck. Thanks so much for any help, or suggestions to do this another way.

I've attached the swf, but the compressed fla was too big. I can email it to anyone willing to fix what is probably very simple, except to the newbie with little but increasing experience!

I'm using Flash MX.

LoadMovie In A Target Without Inherit Of Target Properties?
hi,

I load a SWF-FILE in a target MovieClip with loadMovie(). After that I want to read the _width and _height of loaded MovieClip (from the SWF-FILE), but I only get the properties of the target MovieClip.

loadMovie ("test.swf", "dummySwf");
trace("height:"+dummySwf._height+"width:"+dummySwf ._width);
//put out the properties from target, not from new clip :-((

any idea?

thanks

Target A Specific Frame In And Instance Using Tell Target
is it possible to target a specific frame in and instance using tell target? I can get the effect i want by using goto frame, however i want to use this mc or .swf in a movie, and i don't want goto frame to affect the whole movie, just the mc.

Target JS Button To Target Frame Swf At Different Html...how?
this is my 2nd post regarding this problem, i'm seeking for many input nad perhaps the example soource file/code...

kind like a loading specific frame of swf from a html hiperlink?!? can it be done?

- say we have a 3 frame swf, located at index1.html
- then i have a button(gif/jpeg htmlpage not flash), located at index2.html

- what i wanna do is when i click the button(JS) on index2.html, it will open the index1.html then start play the swf at frame 2 NOT 1(beginning)

how can we do that?

Load Movie Into Target And Tell Target
when i load a movie into target i can effect thie movie with setproperty but not with tell target, is this "normal"?

Target Not Found: Target="_root.info1"
Okay my problem arises when I load an external swf to a target on my main movie. now the the external swf works great on its own, it has a few MC's which are called via a simple button script - on release -> tell target -> go to and play .... the target is "_root.info1" . However When the file is loaded into my main movie I get the error message ' Target not found: Target="_root.info1" ' obviously it is trying to find the target in the main movie and not in the external swf. Well I just dont know how to fix it, any ideas ?

Thanks

Easy Q: Target Not Found: Target="downtrigger"
I have an MC thats called 'slider' that will slide around the main stage. When different buttons are pressed it will slide in to place and each place will have a dynamic text field that will scroll the appropriate text. When I test the movie the text is viewable but when I click the scroll arrows I get the following error:

Target not found: Target="downtrigger" Base="_level0.slider"

What I would like to know is where I place the

'_level0.slider' on my tell target script, which is as follows:

on (press) {
tellTarget ("downtrigger") {
gotoAndPlay(2);
}
}
on (release, releaseOutside) {
tellTarget ("downtrigger") {
gotoAndStop(1);
}
}

If anyone is interested in looking at the .fla let me know and I can email it. Much appreciated, by the way I have around 2 weeks to get this project finished!

If Target Is Between 1 And X Begion Tell Target... HELP
I have some actionscript in a button that works successfully when a MC has reached a certain frame but doesn't take into account if the MC is already playing, so I want it to say, in actionscript language:

If (/overview:_currentframe is between 1 and 50)
Begin Tell Target.... etc.

How is this done?

Target Not Found: Target="undefined" Base="_level0.hero"
For some reason whenever my hero mc jumps i get this
Target not found: Target="undefined" Base="_level0.hero"

the code for the jump is:
code:

onClipEvent (load) {
vel_y = 0;
jumping = true;
speed = 5;
}

onClipEvent (enterFrame) {
if (Key.isDown(Key.SPACE) && !jumping) {
vel_y = 35;
jumping = true;
}
}
onClipEvent (enterFrame) {
fall = true;
if (this.hitTest(_root.floor)) {
fall = false;
vel_y = 0;
grav = 0;
}
if (fall) {
grav += vel;
vel += 1;
if (grav>=10) {
grav = 10;
}
this._y += grav;
}
}
onClipEvent (enterFrame) {
if (jumping == true)
this.gotoAndStop(2);
}
onClipEvent (enterFrame) {
if (fall == true && vel_y<=5)
this.gotoAndStop(3);
}
onClipEvent (enterFrame) {
if (fall == false)
this.gotoAndStop(1);
}


Any idea how i can clean this up or help w/ the target identifier?

thnx in advance

How Do I Rid Of This Error: Target Not Found: Target="OverworldTheme" Base="_level0"
I was making a main menu and I had looping music on it. I tried to make the music stop after I click the play button so I used the following code:


PHP Code:



on (release) {
    tellTarget ("OverworldTheme") {
        stopAllSounds();
    }
}
on (release) {
    gotoAndPlay(2);





And while I play the video and press the button, the following error comes up:

Target not found: Target="OverworldTheme" Base="_level0"

Any advice on how I could fix this?

What Does Target Not Found: Target="_level0.paddle" Base="?" Mean?
Ok I got this line when playing with this game i was creating:

Target not found: Target="_level0.paddle" Base="?"

But I do have a MC named paddle, and it does work but after a while it has this error. Here is the game:

http://www.angelfire.com/sd/LowRyder/pongdeath.html

Play the game and try to collect the red things. Notice how the paddle will run a crumble animation. After a while, it will stop doing this. When it stops, it shows that error message in the debug window. Nowhere in my code does it try to change the paddle's name. The red things are being duplicated off of another MC. Any ideas?
Thanks.

Target Not Found: Target="WIN4" Base="_level0"
Copyed a movie cliped, renamed it as WIN 4, think I got everything right but i get this error when I click on the button: Target not found: Target="WIN4" Base="_level0" ,but the MC loads up and closes just doesn't show the text from the text file. Any help would be great cuz I'm a newbie.

Can't upload file, board says file to big. Message me on AIM, ICQ, or MSN if you cna help me.

Aim: DjSpinStylez
Msn: DjSpinStylez@aol.com
Icq: 82126077

Thanks

[F8] Target Not Found: Target="undefined" Base="_level0"
I am getting this error when running the movie I'm working on. I have looked around, but cannot find a solution or direct cause on the web anywhere. Can anyone here help? Attached is the .fla.

I had to take the content out of scene 2 due to size restrictions, but the error is still the same.

Target Not Found: Target="undefined" Base="_level0"
Can anyone tell me how to get rid of the the following error message that appears every time i publish my movie.

Target not found: Target="undefined" Base="_level0"

[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

Target Not Found: Target="_root.name" Base="?"
my navigation is stored in a mc which uses the tell target. why canīt my mc find the root movie?

thanks!

Target Not Found: Target="nomes.popupwindow" Base="_level0.nomes"
hi , how do i tell the button to open a movie clip.i get this !
Target not found: Target="nomes.popupwindow" Base="_level0.nomes"
i have a movie clip(nomes) that loads on frame 10 say,
and in the movie clip(nomes) i have the button that i want to press and open a new MC ?? i tried with " tell target and
on (release) {
_root.instanceNameOfClip.gotoAndPlay(2); but nothings working

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]

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