Re: Swapdepth and movieclip(s)
i think your button path changed.
any_btn.swapDepths(someLayer) -->
mcName.any_btn.swapDepths(someLayer)
try this
"Pemac30" <[email protected]> wrote in
message
news:eema71$6k3$[email protected]..
>I have a question about using Swapdepth.
>
> I have three objects. Simple buttons.
> When i'm using SwapDepth it works fine. All objects
response as wanted.
>
> Question/Problem:
> When i make one movieclip of all the buttons together,
it won't work
> anymore.
> I mean Swapdepth.
>
> Who can help me on my way.
>
> Greetings,
>
> Peter Tollenaar
> The Netherlands.
>
i think your button path changed.
any_btn.swapDepths(someLayer) -->
mcName.any_btn.swapDepths(someLayer)
try this
"Pemac30" <[email protected]> wrote in
message
news:eema71$6k3$[email protected]..
>I have a question about using Swapdepth.
>
> I have three objects. Simple buttons.
> When i'm using SwapDepth it works fine. All objects
response as wanted.
>
> Question/Problem:
> When i make one movieclip of all the buttons together,
it won't work
> anymore.
> I mean Swapdepth.
>
> Who can help me on my way.
>
> Greetings,
>
> Peter Tollenaar
> The Netherlands.
>
Similar Messages
-
Swapdepth and movieclip(s)
I have a question about using Swapdepth.
I have three objects. Simple buttons.
When i'm using SwapDepth it works fine. All objects response
as wanted.
Question/Problem:
When i make one movieclip of all the buttons together, it
won't work anymore.
I mean Swapdepth.
Who can help me on my way.
Greetings,
Peter Tollenaar
The Netherlands.i think your button path changed.
any_btn.swapDepths(someLayer) -->
mcName.any_btn.swapDepths(someLayer)
try this
"Pemac30" <[email protected]> wrote in
message
news:eema71$6k3$[email protected]..
>I have a question about using Swapdepth.
>
> I have three objects. Simple buttons.
> When i'm using SwapDepth it works fine. All objects
response as wanted.
>
> Question/Problem:
> When i make one movieclip of all the buttons together,
it won't work
> anymore.
> I mean Swapdepth.
>
> Who can help me on my way.
>
> Greetings,
>
> Peter Tollenaar
> The Netherlands.
> -
On button rollover Dynamic text and Movieclip appear
Hi guys,
I've got an issue - When one of my buttons is rolled over, I want text and a movieclip to appear. When the button is no longer rolled over, I want the text and movieclip to disappear.
The way that I was going to do this was to have anchor_mc as an anchor, and upon rollover have the movieclip play from inside the anchor (as its at the exact X & Y that its needed at) and dynamic text appear.
Questions:
1) How do I attach mc_textbox to mc_anchor --- OR, how do I set coordinate for just where mc_textbox should show?
2) How do I then make the movieclip disappear if the button is no longer rolled over?
3) Is it not possible for me to merge all of the dynamic text functions into one function, using IF statements? I tried this, but couldn't work it out.
AS3 code is attached below.
import flash.events.MouseEvent;
stop();
line1.addEventListener(MouseEvent.ROLL_OVER, line_in1, false, 0, true);
line1.addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
line2.addEventListener(MouseEvent.ROLL_OVER, line_in2, false, 0, true);
line2.addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
line3.addEventListener(MouseEvent.ROLL_OVER, line_in3, false, 0, true);
line3.addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
line4.addEventListener(MouseEvent.ROLL_OVER, line_in4, false, 0, true);
line4.addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
line5.addEventListener(MouseEvent.ROLL_OVER, line_in5, false, 0, true);
line5.addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
line6.addEventListener(MouseEvent.ROLL_OVER, line_in6, false, 0, true);
line6.addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
line7.addEventListener(MouseEvent.ROLL_OVER, line_in7, false, 0, true);
line7.addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
line8.addEventListener(MouseEvent.ROLL_OVER, line_in8, false, 0, true);
line8.addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
line9.addEventListener(MouseEvent.ROLL_OVER, line_in9, false, 0, true);
line9.addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
function line_in1(e:MouseEvent):void
line_output.text = "This is a test made by the MonkeyTest that has previously messed up\n And testing a new line";
function line_in2(e:MouseEvent):void
line_output.text = "up messed previously has that MonkeyTest the by made test a is This";
function line_in3(e:MouseEvent):void
line_output.text = "This is a test made by the MonkeyTest that has previously messed up\n And testing a new line";
function line_in4(e:MouseEvent):void
line_output.text = "up messed previously has that MonkeyTest the by made test a is This";
function line_in5(e:MouseEvent):void
line_output.text = "This is a test made by the MonkeyTest that has previously messed up\n And testing a new line";
function line_in6(e:MouseEvent):void
line_output.text = "up messed previously has that MonkeyTest the by made test a is This";
function line_in7(e:MouseEvent):void
line_output.text = "This is a test made by the MonkeyTest that has previously messed up\n And testing a new line";
function line_in8(e:MouseEvent):void
line_output.text = "up messed previously has that MonkeyTest the by made test a is This";
function line_in9(e:MouseEvent):void
line_output.text = "up messed previously has that MonkeyTest the by made test a is This";
function line_out(e:MouseEvent):void
line_output.text = "";
var mc= new mc_empty(); addChild(mc);It isn't relly clear to me what you have versus what you want, so these answers may be equally unclear to you.
1. One way to join them together is to maually place one inside the other while authoring the file. Another way is to use addChild to add the text mc to the anchor... mc_anchor.addChild(mc_textbox); To control where the text mc appears you can set its x and y properties.using actionscript... mc_textbox.x = 0;
2. To make the movieclip disappear you can set its visible property to false... mc_anchor.visible = false;
3. You can probably reduce that code substantially, though it partly depends on what variations there are really going to be in the text that displays for each rollover. For now, I'll assume the text will be entirely different for each...
for(var i:uint=1; i<10; i++){
this["line"+String(i)].addEventListener(MouseEvent.ROLL_OVER, line_in, false, 0, true);
this["line"+String(i)].addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
function line_in(e:MouseEvent):void {
var lineTarget:MovieClip = MovieClip(e:currentTarget);
// could use a switch instead of the if's in series if you know what a switch is
if(lineTarget == line1){
// do things for line1
} else if(lineTarget == line2){
// do things for line2
) else if.... etc -
Swapdepth inside movieclip(s)
I have a question about using Swapdepth.
I have three objects. Simple buttons.
When i'm using SwapDepth it works fine. All objects response
as wanted.
Question/Problem:
When i make one movieclip of all the buttons together, it
won't work anymore.
Buttons stay at the same level. What must i do to get this
work right?
Who can help me?
Greetings,
Peter Tollenaar
The Netherlands.Hi,
Peter,
Try it
as you said , I create a movie clip named a , then i create 3
more movie clips under the movie clip a named b, c and d and using
this code on the seperate layer on the main time line . I found all
are working properly .
a.b.onPress=function(){
this.swapDepths(this.getNextHighestDepth());
a.c.onPress=function(){
this.swapDepths(this.getNextHighestDepth());
a.d.onPress=function(){
this.swapDepths(this.getNextHighestDepth());
Thanks,
Gunjan -
WARNING: Actions on button and MovieClip
I have the following code that I am trying to get to work
with ActionScript 3.0:
on (rollOver) {
gotoAndPlay("s1");
on (releaseOutside, rollOut) {
this.gotoAndPlay("s2");
on (release) {
this.gotoAndPlay("s2");
The problem is that ActionScript 3.0 will not allow the
script on a MovieClip instance. I am at a loss with what to do, I
work well with examples, so I have posted 2 source FLA that are
identical, the only difference is that one targets ActionScript 2.0
(and works), the other targets ActionScript 3.0 (and does not
work).
Please
take
a lookThere is no need to grasp the changes that fast. You can
still publish files for AS2.
Personally though I am always amazed that folks are still
using the on(clipEvent) style of coding. Generally that style of
coding should have gone away with the introduction of the
MovieClip.onClipEvent syntax with Flash 6 – introduced in
Spring of 2002. If you have been programming AS since 2002 and are
still relying solely on on(clipEvent) then you have bigger issues
than AS3. If you have come to AS more recently I just wonder why
this style was the one you adopted. (By "you" I don't mean you
– tmcquage – specifically. I mean you in the general
sense, and I include all of the Flash community in why did we allow
this to happen.)
You could probably answer that question yourself quick than
posting here! But I just tested it and the stop(); works fine.
I would recommend sticking with AS2 for the time being. Learn
how to use all the movieclip methods from the main timeline, not
from on an instance. Then the change over to AS3 won't be such a
shock. Even if you never go to AS3, you will be so happy you
stopped using instance code. Really. -
Problem with NumericStepper and MovieClip's gotoAndStop
I have a NumericStepper that increment/decrements the slides in a MovieClip called libMC:
<mx:NumericStepper id="slide"
change="{libMC.gotoAndStop(slide.value)}" value="1" minimum="1"
maximum="{numberOfPages}" stepSize="1" />
For some reason when I am on the last slide and try to go back to the
second to last slide (either using the down arrow or entering the
second to last page number in the textbox and hitting Enter on the
keyboard), I still remain on the last slide. This problem ONLY occurs
when going from the last slide back to the second to last slide. All
other slide transitions work fine.
Any ideas?use the trace() function to debug your code.
-
Clip Mask and MovieClip pivot questions
Two more beginner questions:
1) What's the easiest way to invert a clipping mask for a
MovieClip in ActionScript? I tried using a ColorTransformMatrix to
invert the alpha of the mask MovieClip, but it didn't work (looks
like the clip mask simply does nothing where there are no filled
shapes). I would like to add a graphic everywhere EXCEPT within the
area of an animated MovieClip, and due to various requirements I
cannot simply place it behind that MovieClip.
2) Is there a way to set the pivot of a MovieClip in relation
to the animated drawings/frames? It looks like the "origin" of a
movieclip is the lower left-most corner of all the bounding boxes
of all the frames of animation in my MovieClip. So if I set the _x
and _y of a MovieClip in ActionScript to 150,150 it places the
lowerleft-hand corner there instead of what I would like to be
logical center of the MovieClip (say, center of a wheelbase of a
car, or center of the feet of a person, or center of mass of a
rock). I am fine with dialing in an offset, but just wondering if
there is a cleaner way to do it (esp. if I happen to add more
animation frames or replace drawings and the bounding box changes
size).
Thanks,
KenAh, I figured everything out.
1) Actually, the ColorTransformMatrix does work, but I didn't
realize that alpha was 0-255, not 0-1 (you'd think after being
bitten by MovieClip scales being 100 = 100% instead of 1 = 100%,
I'd have guessed, but...). So a ColorTransformMatrix of
(1 0 0 0 0)
(0 1 0 0 0)
(0 0 1 0 0)
(0 0 0 -1 255)
applied to the mask will successfully invert it. Nice.
2) Apparently I had previously messed up grabbing all the
images and dragging them - I had forgotten to turn onion skinning
to "onion all" so that I could actually see everything (all my
images are all on top of each other so it wasn't obvious I didn't
have everything visible). I had been selecting all the frames and
dragging the images around in relation to the registration point,
but only the last 3 frames were actually moving, and they happened
to be a part of the animation I didn't bother triggering while
testing. Oops.
Thanks much for your help.
Ken -
Extending and MovieClip?
This is really aggravating me. I come from a OOP background
so Java and others are natural to me but ActionScript 2 is really
really unintuitive even thought it tries really hard to be a object
oriented language. So sorry if some of my question comes off as
rant/frustration.
I'm trying to extend the MovieClip class but it seems "class
Test extends MovieClip" isn't actually a MovieClip!!! wtf
[code]
class Test extends MovieClip {
function Test(){
trace("constructor called");
lineStyle(5, 0xFF00FF, 100);
moveTo(200, 200);
lineTo(300, 300);
lineTo(100, 300);
lineTo(200, 200);
On frame 1:
import Test;
stop();
var myMc = new Test();
[/code]
It outputs constructor called, but it doesn't draw anything
and in true Actionscript fashion, outputs no errors or warnings
whatsoever.
It seems that a class that extends a MovieClip isn't actually
a MovieClip. So much for that "is-a" relationship that its supposed
to have. or i guess it gives you access to the MovieClip functions,
but theres no point because theres no MovieClip on the stage...
Sure I suppose I could create an empty movie clip in the
constructor and put things in there, but then whats the point of
extending MovieClip? If Test really is a MovieClip it should be
able to draw on itself.
What am I not getting???Yes, I believe its more like you're used to in as3.
So in as2 extending a MovieClip is not "as it should be". But
its not too difficult to get used to. If you're just starting with
actionscript coming from another OOP language you may want to start
with as3.
If you're doing it in as2 then cast the return type of
attachMovie to your class.
var mynewThing:Thing = attachMovie("thingClip", "firstThing",
nextdepth)
There are some 'tricks' to avoid using a library symbol:
"an empty movie clip is automatically created for your class
in your library with the linkage id __Packages.[full class name].
So you could just use that without defining any symbols yourself."
-source:
http://board.flashkit.com/board/showthread.php?t=615810
example: -
Classes and Movieclips question
Hey
I'm just wondering, how do I use/call (say... modify the y
coordinate) of a MovieClip that is placed on the stage, in a parent
class of the Document class?Fuc*in kglad, I love you man. You ended a week long feud I
had with flash because I couldn't get this to work. I'm so happy
about this, it feels so nice to be able to work on my game again
and suddenly a huge part of flash just made sense.
I greatly appreciate your help. Thanks mate :).
For those who may have stumbled across this thread who have
the same problem (it really isn't a problem, but more of a lack of
knowledge of something specific), here is what you have to do:
In my document class I have this function:
[code]
public function CallBaseEngine():void {
helloPerson(player);
[/code]
Now in a parent class of the doucment class (meaning that the
document class "extends" to this class I have this:
[code]
public function helloPerson(player):void {
player.x = 999;
[/code]
player being simply the instance name of a movieclip I have
on the stage.
So what does this code mean for the n00bies? Well in the
first block of code I am simply calling a function called
helloPerson which is located in a parent class, remember children
can "access" their parents but parents can't "access" their
children so if I did the same thing but tried to call a function in
the child class I would get an error saying its not found. However,
you put "player" in the brackets which means that you want to bring
the movieclip with an instance name called player through with you
on your way to call the function helloPerson.
In the second block of code, I am quite simply modifying
where the player movieclip is along the x axis, this is to make
sure that I can access the movieclip called player and the code is
properly working. Bringing along doesn't mean we create a
"duplicate" or anything, it basically is bringing along the
permission to access player.
Thanks again kglad! -
Recover informations between Class and MovieClip
Hello,
I have a page (MovieClip) which is charger and have a attribut a matrix (not the class). On this page, there is some cases (MovieClip) which receive value of the matrix.
Each cases are managed by Class. It's a good option, because I can put a listener into the contructor of the class and not having 64 functions if I have 64 cases. This listener allows to change the value of the cases when it clicked.
The problem is that I don't see how to know when a case is clicked in the page for changing the value of the matrix.
Regards,I have a MovieClip called "Level" and I have created a Class "Level" and a Class "Matrice". The "Level" Class has an attribute mat:Matrice. The "Matrice" Class has a dimension and a 2 dimension array (If dimension = 2, you have a 2x2 matrix).
On the Level MovieClip, you have several Case MovieCLip. I also created a "Case" Class for managing the listener.
And when I clicked on a Case, the text value changed but I can not update the Matrice in the Level Class. -
Hi,
Is there something different going on when, using the getURL
when working within movieClips;
buttColor_mc.onRelease = function(){
mySound.start(0, 1);
trace('You've landed');
getURL("
http://www.adobe.com", "_blank");
This works perfectly, while testing in Flash cs3, but when
embedded into html page using (soundObject javaScript) it loads
perfectly, onRelease plays the specified sound file, but will not
open a browser window. Have not tried it on out server yet. But
surely, if it works while testing in Flash cs3, then it should
work?
Any help here will be more than appreciated; I am currently
in the middle of putting our website together, and am in need of
ROI from this.
Kind Regards,
Boxing BoomHi,
This issue has now been resolved; it was down to the Manager
Settings in Flash Player etc...
Boxing Boom -
I'm using AS3.
Is there any chance of creating a function for an instance of an MC to run URLRequests for different items on different frames, or is the only route to create a new MC instance on each necessary frame and type out the request to pull a photo or.swf? Just wondering if I can cut down on the amount of keyframes I'll foreseeably have.
Hopefully that made sense.
Also, how do I run an animated preloader in the movie clip for when it's fetching and loading a photo.
AND, how can I have the photo fade in (guessing somehow through brightness or alpha)? I know there's a lot being asked here. But with my naivete, I'm daunted trying to do these things inside a movie clip.
If any can offer help, thanks, and let me know if I need to provide more context.oops, my error:
var ldr:Loader = new Loader();
var t:Timer=new Timer(70,0);
t.addEventListener(TimerEvent.TIMER,fadeoutF);
var fadespeed:Number=.03; // use whatever number suits your needs
function loadAndAddF(mc:MovieClip,urlS:String){
ldr.alpha=0;
var urlR:URLRequest=new URLRequest(urlS);
ldr.load(urlR);
mc.addChild(ldr);
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,loadCompleteF);
function loadCompleteF(e:Event){
t.start();
function fadeoutF(e:Event){
ldr.alpha+=fadespeed;
if(ldr.alpha>=1){
ldr.alpha=1;
t.stop();
then on each frame where you want to load an image into a frame movieclip use something like:
loadAndAddF(frameMC,"pics/image22.jpg");
// where frameMC is the name of your frame movieclip and you want to load image22.jpg that's in the pics folder. -
Hello guys I am wondering if you help me. I'm a beginner at Flash and not sure if this can be done.
Basically. On my stage in have two MovieClips. MC_1 and MC_2. When i put the mouse over MC_1 I want it to play a 'label'
that is inside the MC_2 AND a label that is in MC_1. We can call the label name for MC_2 "lidopen" and the label name for MC_1 "stars."
Also if I take the mouse off, I want it to go back to normal, and if i click down I want it to play a new .swf file called "123.swf"
I hope you understand me, and thanks for your help in advanced =)Here is some code that will go in the timeline that contains the two movieclips...
MC_1.onRollover = function(){
MC_1.gotoAndPlay("stars");
MC_2.gotoAndPlay("lidopen");
MC_1.onRollout = function(){
MC_1.gotoAndStop(1); // I assumed 1, so change if needed
MC_2.gotoAndStop(1);
MC_1.onPress = function(){
// do something with 123.swf
I am not clear on your intentions as far as playing 123.swf, so I haven't attempted to code that. IF you are loading it into the same file, then you might use MovieClipLoader.loadClip or loadMovie, or if you are opening a new web page you would use getURL. -
Flash Player 10, strange problem with emdedded fonts and movieclips
Hello, developers! I have a big problem with font embedding
and I can not debug it myself. So I need you help.
I' ve done a simple list of attached movieclips with
textfields inside them, with embedded fonts. I have no problem with
flash player 9 in order to see the list, but in flash player 10 I
can't see it. The font is very common, Arial actually so you can
test it very easily. I am using a font symbol in the library, a
class and an xml file for my data.
Also you can see it online in (if you have flash player 10
you can't see a thing)
http://www.forestonfire.com//research/flash/fontproblem/index.html
I have compiled the file as an exe projector in order to see
it as I do in flash player 9
http://www.forestonfire.com//research/flash/fontproblem/fontinflash9.zip
I have zipped also the source code in order to compile it
yourself.
http://www.forestonfire.com/research/flash/fontproblem/fontembedded.zip
and the same example without embedded fonts (I have the same
problem there so perchaps are not the fonts)
http://www.forestonfire.com/research/flash/fontproblem/fontnotembed.zip
Please, check it and tell me if there is a solution
available. Thank you in advance.I've included also a much more simple example without the xml
and the font symbol, only the class and a movieclip from the
library, but I can't still see it on flash player 10
http://www.forestonfire.com/research/flash/fontproblem/simplyfied.zip
I have no clue about this problem. -
Flash Slide presentation and movieclip looping
Hi,
Im having a problem with the flash slide presentation. I have
on the main timeline of one of my slides a movieclip. When i play
the movie, the clip will loop endlessley. I would like the movie
clip to play just once. In a regular flash movie this would not be
a problem - i could put a stop action on the last frame of the
movieclip. but, doing that in the context of a flash slide freezes
the movieclip at the begining so it does not play at all..
help!Ok, Ive managed to solve item 2. - if you set in the slide
component inspector - "playHidden=false" then the slide animation
will restart any time you reenter the slide. Im still lacking an
understanding of how to stop a motion tween from repeating itself
when it's contained within a movie clip as a motion tween timeline
cannot recieve fram actions apparently...
Maybe you are looking for
-
How do I download all of my music onto my iPhone 6 from the cloud.
I recently purchased an iPhone 6 plus. My music is on there but with the cloud symbol which means I have to download from the cloud to listen to it when not around wifi. What is the easiest way to do this for all of my music. I tried hooking my iP
-
Cannot copy, paste, drag or drop
This suddenlly happened last night. I hadn't downloaded any new files immediately before this and wasn't downloading any software at the time. Basically I can open any folder or file but cannot copy or paste anything or drag items on my desktop or el
-
Credit exposure for agent note agent is vendor ....
Dear Friends , As per client requirement , agent is mapped as vendor through partner determination & vendor is assigned to customer master partner function . Condition records are created manually & it is statistical . Now the client requirement is ,
-
Characteristics value assignments screen- the results button is not visible
Dear Gurus, In variant configuration, while i am assignning characteristics values in the characteristics value assignments screen, the results button is not visible. Even when I try to go to the results option from the Menu (GOTO > Results), it is d
-
Hi, i'am not able to find the redemption code that is required to renew subscription for my creative cloud account. Please advice.