从影片剪辑里面直接回到_root? [英] target right back to the _root from inside movie clips??

查看:60
本文介绍了从影片剪辑里面直接回到_root?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!

好​​吧,我可以加载swf',但我所拥有的是一个滑动菜单,里面有按钮,当按下时,将图像加载到一个空的movieclip。

我真的只需要知道如何回归到整部电影的_root。


它有效当同一个阶段或同一个影片剪辑中的按钮和空影片剪辑很棒时,我需要找出正确的脚本,以便从影片剪辑内的按钮直接定位到我希望图像所在的根目录。我在swf文件夹和flash文件中都有jpegs。


我需要按钮和img_container分开的原因是因为如果你在滑动中向左或向右滑动按钮菜单,图像也滑过。

这是当它们在同一个影片剪辑中时有效:


on (发布){

loadMovie(" lamp1.jpg"," img_container");
_root.img_container ._ xscale = 40
< b> _root.img_container ._ yscale = 40

}


...但是我正在尝试使用目标路径,它'工作不太好......


on(release){

loadMovie(" lamp1.jpg"," img_container");
this.img_container ._ xscale = 40;
this.img_container ._ yscale = 40;

}


任何想法,或者我如何更好地构建这个想法都会很棒!

谢谢!

Hello All!
Well, I can load in swf''s just loverly, but what I have is a sliding menu, with buttons in it, that when pressed, load an image into an empty movieclip.

I really just need to know how to target back to the _root of the whole movie.

It works great when the buttons and empty movieclip in the same stage or same movie clip, however I need to work out the right script to target right back to the root where i want the image to sit, from a button, inside a movie clip. I have the jpegs in both the swf folder and inside the flash file.

The reason I need the buttons and the img_container separate is because if you slide the buttons left or right in the sliding menu, the image slides across as well.

Here is what works when they are within the same movie clip:

on (release) {
loadMovie("lamp1.jpg", "img_container");
_root.img_container._xscale = 40
_root.img_container._yscale = 40
}

...however i''m trying to use target path, and it''s not working too well...

on (release) {
loadMovie("lamp1.jpg", "img_container");
this.img_container._xscale = 40;
this.img_container._yscale = 40;
}

Any ideas, or how I could better structure this would be wonderful!
Thanks!

推荐答案

嘿所有!


好​​的,我让它上班了!

我以为我会在这里发布答案! =)

基本上答案是将我的img_container(载入图片的电影......)放到另一部放在_root上的电影中。


so:


on(release){

loadMovie(" lamp1.jpg"," _root.staticI.img_container");

_root。 staticI .img_container._xscale = 40;

_root。 staticI .img_container._yscale = 40;

}


只是从根部直接取下它就行了!

yay! =)


*此网站的一个问题已从列表中删除! = P *
Hey All!

Ok, I got it to work!
I thought I would post the answer here! =)

Basically the answer was sticking my img_container ( the movie that load in images..) into another movie placed on the _root.

so:

on (release) {
loadMovie("lamp1.jpg", "_root.staticI.img_container");
_root.staticI.img_container._xscale = 40;
_root.staticI.img_container._yscale = 40;
}

just took it straight off the root, and it worked!
yay! =)

*one problem with this site ticked off the list! =P *


很棒,你有这个工作。

一个对你和每个人都有用的建议:

不要使用_root,因为如果使用_root作为参考的电影由于某种原因被加载到另一部电影中_root将引用其他电影,试试这个,制作一个名为home的变量(for例如)并使其等于此(伪元素this我的意思)。因此,home对象现在将成为当前的根元素,您将避免嵌套问题。您也可以从任何您喜欢的地方调用此主页对象,它仍然是您电影的根源。即使你的电影是在另一个电影里面调用的。

Great that you have that working.
An advice that'' will be usefull for you and for everyone:

don''t use the _root, cause if the movie that is using _root as reference is for some reason loaded inside another movie the _root will be referencing that other movie, try this, make a variable named home (for example) and make it equal to this (the pseudo-element "this" I mean). So the home object will be now the current root element and you''ll avoid nesting problems. Also you can call this home object from wherever you like and will still be the root of your movie. even if your movie is being called inside another one.

展开 | 选择 | Wrap | 行号


谢谢xNephilimx,


有趣的是你应该提一下,这部电影实际上是要放在另一部主电影中来削减负荷,而这正是我所遇到的问题!


我不太熟悉var.script,但知道我知道哪里至少我出错了!我会玩一玩!


谢谢堆!

=)
Thanks xNephilimx,

Funny your should mention that, this movie is actually going to sit within another main movie to cut loading, and that''s exactly the problem i''m having!

I''m not too familiar with var.script, But know I know where at least i''m going wrong! I''ll have a bit of a play!

Thanks Heaps!
=)


这篇关于从影片剪辑里面直接回到_root?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆