Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TellTarget/With problem. Flash can't see object.

Status
Not open for further replies.

HotMadras

Programmer
Apr 20, 2001
74
GB
Hi,

I'm completely flummoxed by this one. I have a movie inside another movie that I am attempting to control with a button in the outer movie (I hope that makes sense!). I assumed that I could use tellTarget to send the inner movie a stop command but it doesn't seem to work. I have called the inner movie "balls" and used the following actionscript (in the stop button) to stop it:
Code:
on (release) {
	with (balls) {
		stop ();
	}
}

Am I doing something stupid here?
 
Ok, you have 3 movies?...Main movie, movie embedded, and another movie embedded even further into the second?...

If so, you might have to go...
_root.[red]movie1[/red].balls

replacing movie 1 with your second embedded movie name...hope THAT makes sense...you should be able to play w/ your 'balls' after that...lol...if your calling from the main movie...

Also make sure you have that name in there, last week there was just a naming problem.

If that doesn't solve your problem, Yoda (OldNewbie) should be around and try to help.

Regards,
AnthLOLny
----------------------------------------
The Learning process is just a way to get rid of all the stupids in your head.

Now where's that cute little kitten? :-X
 
Luke is right if you have 3 movies embedded in each other.
on (release) {
_root.movie1.movie2.stop();
}
movie1 & movie2 being the instance name of these mcs. _root is the main timeline movie.

This would also work:

on (release) {
tellTarget ("_root.movie2") {
stop ();
}
}

;-)ldnewbie
 
oldnewbie.....I'm learnin!...told ya I would...now the only problem is to learn to not have fun so I dont make virt mad...=P
Regards,
AnthLOLny
----------------------------------------
The Learning process is just a way to get rid of all the stupids in your head.

Now where's that cute little kitten? :-X
 
Correction to my previous post:
If movie2 was inside movie1, this would be the correct script with the use of tellTarget:

on (release) {
tellTarget ("_root.movie1.movie2") {
stop ();
}
}

Got that Luke? How come you didn't spot that one?

;-)ldnewbie
 
Hmm... for some reason that still doesn't work for me. I would post it on the web for you to look at but it's kind of huge. It's a cd-based project so it's a good chunk larger than a website would be.

I've used tellTarget before and it worked fine. I can't work out where I've gone wrong.

Thanks for the responses guys.
 
did you make sure you gave all your instances the correct name?
e.gif


carlsatterwhite@endangeredgraphics.com
 
Old, I did catch it, I just kinda thought you were talking about controling his 2nd movie...and I'm just too lazy to post about little stuff like that anyhow.
Regards,
AnthLOLny
----------------------------------------
The Learning process is just a way to get rid of all the stupids in your head.

Now where's that cute little kitten? :-X
 
As far as I can see, everything has been named correctly. I have a movie called "balls", inside which there is another movie called "arse", if you'll pardon this unusual naming scheme. So I have used:

Code:
on (release) {
    tellTarget ("_root.balls.arse") {
        stop ();
    }
}

I get an error telling me that there is no object called "balls"

 
You have it backwards, put _root.arse.balls and you should be fine...the thing is your calling it incorrectly, it's looking for 'balls' within your root movie, when arse is the one that's there...
Regards,
AnthLOLny
----------------------------------------
The Learning process is just a way to get rid of all the stupids in your head.

Now where's that cute little kitten? :-X
 
Come again Luke? I think you're reading it backwards!

As Carl said, looks like an instance name problem.
Hot...
Are you typing this tellTarget action, or using the target editor?
When you're in the actionscript box, in normal mode, and the tellTarget action is selected, clear any text you have typed in the target field. Make sure the cursor is still in that field and hit the crosshair on the bottom right. A target selector should popup and you should see something like this:

_root
->+ balls

If you open up balls, you should see arse as such:

_root
->+ balls
-> arse

You can then select it as your target by double-clicking on arse & OK.
If you don't see this structure, you probably have an instance name problem.

;-)ldnewbie
 
I think your wrong for once Oldnewbie...I dont think I'm dyslexic...

He has the BALLS movie, WITHIN the arse movie...and the ARSE movie is on his main timeline...

So that would make the order _root.arse.balls

Going from the Root, down in the structure...he is trying to call balls from his main timeline w/ the code he is using, when balls is nested within NOT _root, but ARSE.

Get my reasoning...take a second look at it Oldnewbie...
Regards,
AnthLOLny
----------------------------------------
The Learning process is just a way to get rid of all the stupids in your head.

Now where's that cute little kitten? :-X
 
Sorry WhiteTiger, but you do have it the wrong way round. Balls is in my main timeline, arse is inside that. I haven't tried Oldnewbies solution yet but I'm about to. It looks more promising, since I was typing all this crap in before.

Thanks again guys
 

... I have a movie called "balls", inside which there is another movie called "arse"...


To me this means the movie "arse" is inside the movie "balls", which in turn is on the main timeline!
As movie2 is inside movie1 which is on the main timeline!

Are we on the same planet?

;-)ldnewbie
 
Ok. I tried your solution, Oldnewbie, unfortunately neither balls nor arse appears in the window. I assume this means that I have done something daft and should probably be publicly flogged. What can I do to fix it?
 
You probably (note that I'm never as affirmative as Luke can be!) have not named or wrongly named the instances of your movies. Select movie "balls" and under Window->Panels->Instance, name this instance balls. Do the same for "arse". You should now see them in the target selector and will be able to select the right one!

;-)ldnewbie
 
I've already done that. I can't see that there's anything else I can do. The reason I know they're called "balls" and "arse" is because I looked in the Instance panel. I'm doomed aren't I?
 
How large is your .fla?
You can allways send it to me at oldnewbie@hotmail.com
Leaving in few minutes, for the rest of the day... Won't be back before tonight, but if you send it now, I may have time to take a quick look at it.
Zip it up and mail it to me.

;-)ldnewbie
 
Ordinarily I would, but sadly I'm under an NDA on this one. I can show you, but then I'd have to kill you! It's not all that time critical. I'll take a look at it again tomorrow morning and if it's ok I'll snip out the relevant bits so you can take a look. I can probably get away with sending you a little tiny bit.

I'm not normally this hopeless, honestly!
 
Send me what you can! No worries!
Leaving, back 10:00ish!
Will send you a template you can have a look at if you send your e-mail address at my above address.

Catch you later,

;-)ldnewbie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top