Stacking Multiple Swf's + Php
Hello, thanks for reading this post. Hopefully you can help me out.
Let me start my explaining the problem. I have a index.php file in which i have created an embedded object using the SWFObject. In this object i call for flvplayer.swf with the file variable movie.swf?id=1. I have the movie.swf receive the id and pass that on to getmovie.php. This php file returns a variable URL back to the movie.swf. Now, I want movie.swf have the URL played in the original embedded object in the index.php file.
Why so difficult? To protect the URL of the actual content. Now, here's my code...
index.php
Code:
<script language="javaScript" src="scripts/swfobject.js" type="text/javascript"></script>
<div id="movie">
<span class="text1 wit">
<strong>Flash player is niet geinstalleerd</strong>
Om deze video te bekijken is Flash player 7 vereist. Wanneer de player niet automatisch installeerd kunt u via onderstaande link de player downloaden:<br />
<a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Download Flashplayer</a>.
</span>
</div>
<script type="text/javascript">
var so = new SWFObject("flvplayer.swf", "mymovie", "260", "215", "7", "#ffffff");
so.addVariable("autoStart", "false");
so.addVariable("volume", "true");
so.addVariable("id", "1");
so.addVariable("file", "movie.swf");
so.addParam("wmode", "opaque");
so.write("movie");
</script>
movie.swf
Code:
myVars = new LoadVars();
myVars.load("http://localhost/mediame/getmovie.php");
myVars._path = this;
myVars.onLoad = function(success) {
if (success) {
this._path.url = this.url
locatie = myVars.url;
_root.createMovieClip("v_mc", _root.getNextHighestDepth());
_root.v_mc.loadMovie(locatie);
} else {
trace("error loading page");
}
}
getmovie.php
Code:
<?php
$vars = "url=NL20_Chelsea_HetCentrum2.flv";
echo $vars;
?>
I know the problem is somewhere in movie.swf. Can anyone tell my how to play LOCATIE into the original MyMovie object in index.php?
I don't have the post the source of flvplayer.swf because everybody knows that..
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 09-18-2006, 11:29 PM
View Complete Forum Thread with Replies
Sponsored Links:
Multiple Xml Gallery Stacking... Can It Be Done?
I'm stumped... Does anyone know if it's possible to load 2 independent xml galleries into a single movie using 2 empty containers. See example (link below). What i'm trying to achieve should become clear? I imagine changing the content for the 2nd gallery but for now am pulling from the same library...
Thanks in advance – Dax
Source files:
http://catchymedia.co.uk/example.zip
View Replies !
View Related
Multiple Movie Loading & Stacking
Hi there,
Hope you don't mind a returning member.
Overview
I've been away from Flash for quite some time (4 years or so), but had to leverage on it again based on a client request. The client is a bit demanding and explicitly requested animating a series of bitmaps into a movie that needs to be 760x220 pixels in dimension in order to fill his entire website banner. Worse, he wants that to be repeated for each page with a different set of bitmaps, i.e. different animated banner per page—a total of 8 pages/animations.
The Task
At this dimension, I bet you realise how large the size of each bitmap. Imagine that with 15 JPEG high quality images (photos) per movie, which totals to: 15x8=120! The problem is that client wants different animation effects for each bitmap, in a style as if you were holding a camera and photographing a short video clip (move camera sideways, at different speeds, zooming in/out, etc). I uselessly tried to explain the implications, but he didn't bother! So, I had no option but to abide.
Situation
Upon demonstrating the first draft of home page animation, he got so excited and requested uploading it to his site and proceeds in producing remaining movies. The movie was around 1MB (!) in size and lasted for 95 seconds. I deliberately didn't do any optimisation and uploaded the movie as is. When he viewed it online, he got shocked; it took ages to load (obviously) and the site main menu (JavaScript) didn't show until the movie was fully loaded.
At the end of the day and after a lengthy debate, he became a bit understanding after realising the consequences. Therefore, he dropped the idea of multiple animated banners for inside pages, and agreed to limit animation to home page, but without dropping the idea of animated bitmaps! For that, he requested us to find a way to speed movie loading and offered to cover any additional cost involved!
Interesting marketing tactic with such type of customers, isn't it?
The Challenge
Anyway, here begins the true work of optimisation! Used shared libraries, converting every bitmap/graphic into symbols and split the movie into 3. Didn't help much as loading slightly improved.Loading & Stacking movies:
I know it shouldn't be that difficult; the posts here plus tutorials at Macromedia and Nunomira are great and should do, but it doesn't exactly work as I want.
Tried loading all movies into root (level 0) but due to low speed of loading and large size of movies, there appears a blank gap between movies. So, tried loading them into different levels by placing LoadMovieNum() in the last frame of each movie according to following sequence:
Dummy movie (DM): level 0 --> movie 1 (M1) into level 1 --> movie 2 (M2) into level 2 --> movie 3 (M3) into level 3.
They appear to load nicely without noticing that annoying gap in between.
The challenge here is that upon completing M3 animation sequence, animation needs to be repeated, so control needs to be sent back to play frame1 of M1 (L1) which is now hidden below M3 (L3)! I anticipate SwapDepth() might be the way to do it, but this would complicate things I assume. If used correctly, M1 should be in L3 after swapping, so I need another swap to play M2 that occupies L2, then another one to shift control from M2 to M3, and so on. If my understanding is correct, would someone kindly tell me how to exactly script that?
Is there a more feasible alternative to smoothly load the 3 large movies one after the other?
Dummy Movie:
As you may have noted, I mentioned a dummy movie but didn't include it in the sequence above. This movie has a two-fold task:
first, it will allow the main menu to be generated and displayed after loading due to its small size,
and second, it exports part of common symbols for runtime sharing of other movies, hence, speeding up their loading.
The movie consists of a still bitmap that also works as a background for M1 which starts animating same bitmap once loaded. Therefore, the dummy movie will no longer be needed to play actual animation sequence.
Bitmap Loading at Runtime:
Would loading the bitmaps at runtime improve movie loading and performance? We are talking 15 different JPEGs here that vary in size. If so, how to convert the bitmaps to symbols/instances and animate them at authoring if they are going to be available only at runtime?I know that someone might advise me to experiment all of that, but as I said I was a way for a long time from Flash, thus, lost most my scripting skills. Besides, I was using Flash 4, but with MX I see a lot of new commands and scripting opportunities. Not to mention the very tight schedule.
Appreciate the help and many thanks in advance.
Cheers,
View Replies !
View Related
Multiple External Movie Loading And Stacking
Hi there,
Hope you don't mind a new member. Went through your constructive lengthy list CB, but didn't exactly find what I'm up to, so here is my story.
Overview
I've been away from Flash for quite some time (4 years or so), but had to leverage on it again based on a client request. The client is a bit demanding and explicitly requested animating a series of bitmaps into a movie that needs to be 760x220 pixels in dimension in order to fill his entire website banner. Worse, he wants that to be repeated for each page with a different set of bitmaps, i.e. different animated banner per page—a total of 8 pages/animations.
The Task
At this dimension, I bet you realise how large the size of each bitmap. Imagine that with 15 JPEG high quality images (photos) per movie, which totals to: 15x8=120! The problem is that client wants different animation effects for each bitmap, in a style as if you were holding a camera and photographing a short video clip (move camera sideways, at different speeds, zooming in/out, etc). I uselessly tried to explain the implications, but he didn't bother! So, I had no option but to abide.
Situation
Upon demonstrating the first draft of home page animation, he got so excited and requested uploading it to his site and proceed in producing remaining movies. The movie was around 1MB (!) in size and lasted for 95 seconds. I deliberately didn't do any optimisation and uploaded the movie as is. When he viewed it online, he got shocked; it took ages to load (obviously) and the site main menu (JavaScript) didn't show until the movie was fully loaded.
At the end of the day and after a lengthy debate, he became a bit understanding after realising the consequences. Therefore, he dropped the idea of multiple animated banners for inside pages, and agreed to limit animation to home page, but without dropping the idea of animated bitmaps! For that, he requested us to find a way to speed movie loading and offered to cover any additional cost involved!
Interesting marketing tactic with such type of customers, isn't it?
The Challenge
Anyway, here begins the true work of optimisation! Used shared libraries, converting every bitmap/graphic into symbols and split the movie into 3. Didn't help much as loading slightly improved.Loading & Stacking movies:
I know it shouldn't be that difficult; the posts here plus tutorials are great and should do, but it doesn't exactly work as I want.
Tried loading all movies into root (level 0) but due to low speed of loading and large size of movies, there appears a blank gap between movies. So, tried loading them into different levels by placing LoadMovieNum() in the last frame of each movie according to following sequence:
Dummy movie (DM): @ level 0 --> movie 1 (M1) into level 1 --> movie 2 (M2) into level 2 --> movie 3 (M3) into level 3.
They appear to load nicely without noticing that annoying gap in between.
The challenge here is that upon completing M3 animation sequence, animation needs to be looped, so control needs to be sent back to play frame1 of M1 (@L1) which is now hidden below M3 (@L3)! I anticipate SwapDepth() might be the way to do it, but this would complicate things I assume. If used correctly, M1 should be in L3 after swapping, so I need another swap to play M2 that occupies L2, then another one to shift control from M2 to M3, and so on.
If my understanding is correct, would someone kindly tell me how to exactly script that?
Is there a more feasible alternative to smoothly load the 3 large movies one after the other?
Dummy Movie:
As you may have noted, I mentioned a dummy movie but didn't include it in the sequence above. This movie has a two-fold task:
first, it should hopefully allow the main menu to be generated and displayed after loading due to its small size,
and second, it exports common symbols for runtime sharing of other movies, hence, speeding up their loading.
The movie consists of a still bitmap that also works as a background for M1 which starts animating same bitmap once loaded. Therefore, the dummy movie will no longer be needed to play actual animation sequence.
Loading Bitmaps at Runtime:
Normally, loading the bitmaps at runtime should improve movie loading and performance, but would it be the case here as well? We are talking 15 different JPEGs here that vary in size. If so, I don't seem to comprehend how to convert the bitmaps to symbols/instances and animate them at authoring if they are going to be available only at runtime?
I know that someone might advise me to experiment all of that, but as I said I was a way for a long time from Flash, thus, lost most my scripting skills. Besides, I was using Flash 4, but with MX I see a lot of new commands and scripting opportunities. Not to mention the very tight schedule.
Appreciate the help and many thanks in advance.
Cheers,
View Replies !
View Related
Stacking .swf's
Is it possible to rearrange the stacking order of .swf once they have been loaded?
I can't determine which movie is going to be called first, but I want them all to be preloaded. So therefore I need some way of shuffling them around.
View Replies !
View Related
Z - Stacking
Here's the deal guys -
3 different MC's: "print","web","multimedia"
these are NOT instances of the same clip; they are different clips altogether -
So how can I get this z-stacking to work using swapDepths() so that the clip in the back comes to front while the front clip recedes without going all the way to the back?? I've looked at numerous tutorials for this - obviously they all involve arrays - the only problem is all the tutorials use one MC for the general window. I have separate MC's, so how can I set up the array to cycle this way???
Week-long issue
View Replies !
View Related
Stacking
Question? Is there a way to make one flash movie and expand it to 100% in the publish settings & then have another one to stack on top of it that will not expand to 100%? I want to do this to stretch a background and not morph photographs.
Thanks in advance for answers.
View Replies !
View Related
Stacking Mcs One Above The Other
Hello,
I am trying to attach a movieclip (a rectangle shape) from the library incrementally (i++) by cliking on a button.
My problem is I am not able to stack the latest attached movieclip exactly on top of the last attached movieclip. The movieclip has a height of 25.
What is that not correct? Here is the code:
var p = 1;
btn_rectangle.onPress = function() {
var b = _root.Knowledge_mc.Know_Assesments_mc.attachMovie( "rectangle_mc", "rectangle1_mc"+p, _root.Knowledge_mc.Know_Assesments_mc.getNextHighe stDepth(), {_x:b._x, _y:b._y-25});
p++;
View Replies !
View Related
Stacking
i'm just making a basic game where sand falls from the top by using th following code:
onClipEvent (enterFrame) {
num++;
_root.sand.duplicateMovieClip("sand"+num,num);
_root["sand"+num]._visible = true
_root["sand"+num]._x = _root.car._x
_root["sand"+num]._y = _root.car._y
}
How can i get the particles (sand) to stackup on each other. Thanks in advance
View Replies !
View Related
TOP OF STACKING ORDER POP UP
I'm building a Flash Site which makes use of Pop Up html pages to hold the content, however I want the pop up box to remain on top of the stacking order.
See the following:
http://javascript.internet.com/page-...op-window.html
I've tried to implement the script but just can't get it to work!
How do I do this in Flash?
Please help!
Regards
PADDYWALL esq
View Replies !
View Related
Stacking Instances
Does any one know how to stack multiple instances on one layer so when i click on one of the multiple instances, it comes to the top and the same will happen to the others when i click on them?
View Replies !
View Related
Stacking External MC's On Top Of Each Other
I want to load an external MC to my main MC. But I want it to go over the previous loaded MC.
here is the process: click any of the navigation buttons which loads an external MC - click another button and it preloads another MC over the previous one and unloads the current MC AFTER the new MC's transitions (loader animation) - click on another menu and it loads a new MC over the current again, load the previous MC and it goes on top still, it looks like it stacks everytime you click any of the menus
A good example of what I am talking about is www.nikewomen.com. There is a tab on the left where it opens up panels that you can click. Press any and it preloads a new movie on top of the current. Press another and it preload again on the current loaded movie. Also check www.nikebowerman.com it has the same effect.
Hope someone can help. Thanks to anyone who responds.
syfer707
View Replies !
View Related
Stacking Swf In Html
My .swf file (integrated just below an expanding external.js menu in my html document) blocks the menu when expanded. Is there some way to control the stacking order of either .swf or .js so the menu appears 'on top' of the .swf file?
View Replies !
View Related
Stacking Levels Up
Real quick...what I would like to do is...assign a +1 level code to my movie clips so the selected movie clip always plays one level higher than the previous. Creating a stack. Anyone have experience with this?
View Replies !
View Related
Stacking Div Over A Flash
hi are there any new ways of stacking a div over another div that has a flash movie in it. so the movie will be running under a div.
i know there is a way to do it with iframes but just wondering if there are any new developments for this issue that comes up a few times a year for me.
-best
kvn
View Replies !
View Related
[CS3] Falling & Stacking
Hey all,
I'm looking to create a falling objects effect (colored boxes in this case) that when they hit the bottom of the stage begin piling up on each other. Once the stack gets to a certain point the bottom row sinks down to create a continued looping effect.
Any ideas on the best way to achieve this?
Much thanks!
View Replies !
View Related
Stage Stacking
Hey everybody! I have an image of a Cloud that I have made into a Class so that way I can generate multiple instances of it on the stage and I've noticed that every Cloud that is generated appears on top of everything else no matter where I put the "addChild" statement in my TimeLine code, how do I fix this?
View Replies !
View Related
[CS3] AS2 How Do I Stop MC's From Stacking?
I'm working on a project where triangles are filled with different colors and patterns. The problem I am running into is that each time the triangles are filled, the previous fill is still behind the new fill, which makes the file run really slow as the fills stack up. I tried a few things in an attempt to fix the file, but can't get it to work. I have attached a mini version of my Flash file. The code I am using for the fill all buttons is below:
PHP Code:
on (release) {
tileBG_all = function () {
for(i=0;i<=58;i++){
tile_width = 34;
tile_height = 34;
//
x_max = Math.round(340/tile_width);
y_max = Math.round(170/tile_height);
for (x=0; x<=x_max; x++) {
for (y=0; y<=y_max; y++) {
bg = _root["Tri"+i]["c"+i].attachMovie("square4", "bg"+x+y, _root["Tri"+i]["c"+i].getNextHighestDepth());
bg._x = tile_width*x;
bg._y = tile_height*y;
}
}
}
};
tileBG_all();
}
All the fill buttons are the same. The only thing that changes is the movie that is attached, for example "square4" changes to "square5". I don't have much of a handle on actionscript, but from reading previous forum posts I thought that maybe loading the movie clips on the same level would be the solution. I tried changing
PHP Code:
getNextHighestDepth()
to
PHP Code:
_level10
and when that didn't work, tried changing it to
PHP Code:
getNextHighestDepth(10)
which also didn't work. I'm not sure how to approach this problem. Does anyone have any suggestions?
Another less pressing thing is that I also wanted to be able to have a random fill button. I got it to work at some point way before the current version of the file when I wasn't using movie clips as my fills, but don't know how I would even get started on doing the same thing at this point. Does anyone have a suggestion?
Any help would be appreciated.
View Replies !
View Related
Layer/stacking. How Would I Do This?
Hello,
I have 6 boxes on my stage.
This is what I'd like to do.
When a box is clicked it "grows" to fill the stage covering the other boxes, and then plays it's content. When it gets to the end of it's content it "shrinks" back.
This would happen with each box.
My problem is that the way I've tried to do it, the boxes don't cover each other. They grow under the other boxes!
The reason this happens is because I have my boxes in different layers so they they are under each other.
I'm not advanced enough in AS to do this the AS way as I've seen it done with gallery's.
Is there a way to do it my way but stick in some code to tell the movie that is clicked to move to the top?
This is my AS for the box:
PHP Code:
panel1.onPress = function(){
panel1.gotoAndPlay("grow");
}
I guess i'm after something to stick in there that will move "panel1" to a top layer. Is that possible?
The simpler the better if that's possible.
Thanks for any help.
View Replies !
View Related
Falling & Stacking
Hey all,
I'm looking to create a falling objects effect (colored boxes in this case) that when they hit the bottom of the stage begin piling up on each other. Once the stack gets to a certain point the bottom row sinks down to create a continued looping effect.
Any ideas on the best way to achieve this?
Much thanks!
View Replies !
View Related
Can't Keep Movieclips From Stacking
I'm trying to call movieclips from the library to the stage. To do so, I have a list of questions in a list. As a user clicks on the questions, the movieclip associated with it will be placed (at the top of a list) on the stage.
This part seems to be working. The problem is that all of the movie clips on the right side are being stacked on top of each other... instead of actually displaying in a list (one below the other).
I've attached an example image and the actionscript. Does anyone know what I can do?
ActionScript Code:
//Create listener object
var listListener:Object = new Object();
listListener.change = function () {
trace(aList.selectedItem.label);
};
//Add listener.
aList.addEventListener("change", listListener);
var listListener:Object = {};
var i:Number = 0;
listListener.change = function ():Void {
var newName:String = aList.selectedItem.label;
if (aList.selectedItem.data == 1) {
var mc = _root.attachMovie("dragged","mc"+(++i),i)
}
mc.inText = newName ;
if (aList.selectedItem.data == 2) {
var mc = _root.attachMovie("2","mc"+(++i),i)
}
mc.inText = newName ;
mc._x = 190 ;
mc._y = 5 ;
};
//Add listener.
aList.addEventListener("change", listListener);
View Replies !
View Related
Stacking Boxes
Hi i made this small flash program where your supposed to stack boxes. But right now I cant make it so that the other box will fit right on the 1st box. I believe theres something wrong with the collision detection. Here is the actionscript for box2 which falls right after box1 (supposed to land on it).
ActionScript Code:
onClipEvent(load){
velocity = 0;
gravity = 2;
friction = 0.01;
floor = 400;
}
onClipEvent(enterFrame){
velocity += gravity;
velocity -= friction*velocity;
_y += velocity;
{if(_y>floor){
_y = floor;}
}
if(this.hitTest(_root.box._x, _root.box._y, true)){
friction=1.00;
}
//or it's opposite:
if(_root.box.hitTest(this._x, this._y, true)){
friction=1.00;
}
}
can someone help me so the 2nd box will land on the top of the 1st box, not in the middle of it? here is my zip file also:
View Replies !
View Related
Interactivity VS Stacking
Hi,
an MC A is interactive, above is place an MC B who s not interactive.
PROBLEM : where MC B is placed, interactivity of the MC below (A) is disabled. How to avoid that ?
exemple :
http://www.tapiocadesign.com/interactEmpilement.fla.zip
Merci, Sylvain.
View Replies !
View Related
Stacking External Mc
Hi,
On my scene i have a button, and on press it calls an external swf.
this swf is covering the whole scene but the button underneath is still sensible(but not visible).
why?
I have assigned a _level to this external swf...
So how can I do so that the button underneath is not reacting on mouse over?
Hope I described my problem well...
Thx for helping
View Replies !
View Related
Stacking Blocks
I want to have a bunch of blocks fall from the sky like rain then stack up when they hit the floor of the stage. anyone know how I would go about this?
I'm going to start by creating the blocks and then jamming them into an array from there i can control their falling speed but I don't know where to start as far as the collision detection. I was initially thinking of using a hit test to stop the blocks when they hit each other but quickly realized that if they hit each other mid flight they would stop where they were
View Replies !
View Related
Stacking Buttons
I'd like to combine a slider with buttons. I did slider this tutorial:
http://www.kirupa.com/developer/mx/slider.htm
Now, I'd like to place buttons beneath the slider, so when I drag the dragger and in doing so roll over a button that lies beneath, that button will react. However, it seems that when the slider is active, the buttons don't react.
Furthermore: can I stack same-size buttons on top of each other, and still get the lower buttons to react when hovering over the top button? By having two same-sized buttons exactly placed over each other, activate both with 1 click? Any help much appreciated!
View Replies !
View Related
Falling & Stacking
Hey all,
I'm looking to create a falling objects effect (colored boxes in this case) that when they hit the bottom of the stage begin piling up on each other. Once the stack gets to a certain point the bottom row sinks down to create a continued looping effect.
Any thoughts on the best way to achieve this?
Much thanks!
View Replies !
View Related
Stacking Order...
Hi all,
I have quite a bit of experience with animation, but I'm a total noob when it comes to actionscripts. I'm currently doing a project at work and I want to learn how to change the stacking order of movies. The transition from one page to another involves the previous page being "wiped over" by the selected page. For example, if I'm currently at the "home" page, and selected "about us" page, all the elements on the home page will be covered by the about us page. So the way I want it to work is whatever page is selected should always be on top of the page you are currently on.
Would appreciate any help, tia.
View Replies !
View Related
Stacking Movies
Ok, I have a stack of movies (six, one ontop another) on the stage.
I'm trying to make it that when you mouse over a button elsewhere on the stage it makes #1 the top movie clip- and subsequently if clicked would play that #1 movie clip. THen a second button moused over would bring movie clip #2 to the top and ready to be played.
Any ideas on how to control this?
I've been messing with setProperties til I'm blue in the face, but you can always seem to see one of the clips ontop of the one that is getting played.
I attempted swapDepths- but this didn't seem to work either.
Suggestions appreciated.
-M
View Replies !
View Related
Stacking External Mc
Hi,
On my scene i have a button, and on press it calls an external swf.
this swf is covering the whole scene but the button underneath is still sensible(but not visible).
why?
I have assigned a _level to this external swf...
So how can I do so that the button underneath is not reacting on mouse over?
Hope I described my problem well...
Thx for helping
View Replies !
View Related
Stacking 2 Swf Files
I'm having an issue with two separate swf files on same page. they overlap and one should animate under the other (set up so by z-index of their respective divs). The bottom one however keeps jumping on top, covering what I want to be in front...
how do I handle this?
View Replies !
View Related
MouseListener With Stacking
Last edited by David_King : 2006-01-30 at 08:44.
Hello, fellow ASheads (hawhaw, I will never tire)
If (like me) you get sick of adding and removing listeners, getting old ones still running in the background no matter what you try, and general poo-ness. You may want to give this little bit of code a stab. I know, I know, I should write it as a class, but it just emerged from a project. Does what it sez on the tin:
Edit: which isnt immediately apparent... OK, so its basically a function called setMouseFunction() that you can pass various things to to help manage your mouselistener object. The mouseListener bit is the ONLY listener, but it calls everything in the stack built up by the aforementioned function. And the last bit is just a dummy function!
ActionScript Code:
/***************** setMouseFunction *******************
Sets a function for the mouseUp or the mouseDown.
Variables are as follows:
mouseEvent "Up", "Down"
myFunction a STRING of the function to call
myFunctionParams The Parameters to pass to it
stacking "push" -> adds event to the stack
"unshift" -> adds it to the start
"overwrite" -> overwrites all events
******************************************************/
MOUSE = new Object ();
MOUSE["downStack"] = new Array();
MOUSE["upStack"] = new Array();
//
function setMouseFunction (mouseEvent, myFunction, myFunctionParams, stacking) {
//
// Get the right stack:
myEventStack = MOUSE[mouseEvent.toLowerCase()+"Stack"];
//
// Add it to the stack:
if (stacking == "push") {
myEventStack.push ([myFunction, myFunctionParams]);
} else if (stacking == "unshift") {
myEventStack.unshift ([myFunction, myFunctionParams]);
} else {
myEventStack.splice(0);
myEventStack.push ([myFunction, myFunctionParams]);
}
}
// EXAMPLES:
setMouseFunction ("down", func, ["string a", {a:1, b:2}], "push");
setMouseFunction ("down", func, ["string b"], "push");
setMouseFunction ("down", func, ["string c"], "unshift");
setMouseFunction ("up", func, ["string d"], "push");
setMouseFunction ("up", func, ["string e"], "overwrite");
/****************** mouseListener *********************
The listener that calls the required functions, in
order. Simple
******************************************************/
editListener = new Object();
editListener.onMouseUp = function () {
for (s=0; s<MOUSE["upStack"].length; s++) {
var theFunction:Function = MOUSE["upStack"][s][0];
theFunction.apply(this, MOUSE["upStack"][s][1]);
}
}
editListener.onMouseDown = function () {
for (s=0; s<MOUSE["downStack"].length; s++) {
var theFunction:Function = MOUSE["downStack"][s][0];
theFunction.apply(this, MOUSE["downStack"][s][1]);
}
}
Mouse.addListener(editListener);
/**************** the real functions ******************
These are the functions that are called by the
mouseListener, could do Dragging, Dropping, etcetc
******************************************************/
// Haha, what a way to start it off, a fake one:
function func (myStr, myObj) {
trace ("myStr: "+myStr);
if (myObj) {
trace ("myStr: a:"+myObj.a+", b: "+myObj.b);
}
}
Dissect, and Disseminate!
DK
Alterationsupdated for Codemonkeys comments
altered the while loops on the listener to go in the correct order, :s
View Replies !
View Related
MovieClip Stacking
Hello All,
I am trying to figure out how to stack movieClips on the _y coordinate.
I know that using the duplicate Movie function it will allow you to stack the movieClips on the x axis (on top of each other).
What I want to do is duplicate a box a number of times depending on the amount in a XML doc. Once the movieClip is duplicated, I want each one to stack vertically on each other using the y coordinate.
Any suggestions would be great! Thanks!
Lostcook :)
View Replies !
View Related
Stacking Order Of Movies
i have two movies that are running at the same time and i want to change the stacking order depending on which one is clicked on. they are obviously both viewable at the same time and i would like one to go on top of the other when clicked. any ideas? i've tried using movieclip.swapDepths(), but with no luck.
View Replies !
View Related
Layer/stacking Question
Hi,
I want to have 6 boxes on my stage (thumb nails lets say).
When you click on one it grows in size and covers the stage and other boxes (and plays its content). You click it again and it shrinks back.
Click another box, it does the same.
Here's my problem...
The way I've done it is have the boxes on stage (as movie clips) on different layers.
Each box has it's grow shrink tween.
Trouble is i cant figure out how to get them to cover the other boxes as each box is on a layer UNDER the other box!!
I need the box that's clicked to be on the top layer.
How your you do this?
Maybe I should post this in the AS forum.
Thanks for any help.
View Replies !
View Related
Stacking/Balancing Game
Hi guys,
Just a quick post to see if anyone has seen anything similar out there in terms of source files to Ferry Halim's Pig Game. I am making a similar style game, which should stack objects on button press and balance accordingly, with the stack collasping if the objects are not stacked properly.
Any help with this would be much appreciated.
Cheers,
James
View Replies !
View Related
Stacking Flash Layers
I want to display a text layer over 2 flash layers, i've set the first flash layer to transparent, so the second flash layer displays fine, i now want to put a 3rd layer that contains just text on top of this, does anybody know if this is possible?
View Replies !
View Related
Stacking Many Objects In The Stage
Im trying to make a slide show of many pics (sliding from right to left) but there is a problem. They wont fit in a straight line when stacking them in the stage. There is just not enough room to stack them all in, and then make the sliding! What can i do?
I have attached the sample but i haven't put it all to be working properly, i have just added the extra samples i wanted, so you can get an idea when the fitting is beginning to become a problem!
View Replies !
View Related
FormItems Stacking When I Add Component
Hi all,
I am using FlexBuilder 3 Beta 2, and am (relatively) new to Flex.
I have a custom component and am trying to add that into a form as part of a form item.
The issue is that when I include this component it messes up the entire form:
a) the component doesn't show up and neither does the textInput also in that formItem - so the entire formItem doesn't show up (no border appears)
b) the other form items (each with only a textInput) are stacked on top of each other.
But when I just take out the item everything shows up fine. This component is derivation of the Slider Class, and I haven't really overwritten any code.
I could hack it I'm sure but would like to find out what's going on. ???
Any ideas or tips anyone has would be greatly appreciated.
Thanks
View Replies !
View Related
Levels/Layer Stacking In AS3
Hi everyone,
I have action script set up to make some balls rotate on an elipse using Action Script 3. The code looks like this:
ActionScript Code:
var angle:Number = 45;
var originX:Number = 360;
var originY:Number = 200;
var radiusX:Number = 360/2;
var radiusY:Number = 32;
var steps:Number = 60;// Here you can declare how many steps a round trip should be made of
var speed:Number =3.1415/steps;
photo_mc.addEventListener(Event.ENTER_FRAME ,moveButtons);
// remember to vary this one like 0 for the first button 72 for second 144 for the third one and so on. of course only if you plan to use 5 buttons the formula is 360/numberofbuttons I added increments of ten to evenly space them all...
photo_mc._order = 360/5+10;
illustration_mc.addEventListener(Event.ENTER_FRAME ,moveButtons);
illustration_mc._order = 360/5+20;
interactive_mc.addEventListener(Event.ENTER_FRAME ,moveButtons);
interactive_mc._order = 360/5+30;
contact_mc.addEventListener(Event.ENTER_FRAME ,moveButtons);
contact_mc._order = 360/5+40;
home_mc.addEventListener(Event.ENTER_FRAME ,moveButtons);
home_mc._order = 360/5+50;
addEventListener(Event.ENTER_FRAME,controlButtons );
function moveButtons(e:Event) {
e.currentTarget._anglePhase = angle+e.currentTarget._order;
e.currentTarget.x = originX + Math.sin(e.currentTarget._anglePhase) * radiusX;
e.currentTarget.y = originY + Math.cos(e.currentTarget._anglePhase) * radiusY;
}
function controlButtons(e:Event) {
angle+=speed;// with 30fps and speed set to 1 ; the buttons will travel around in 12 seconds
if (angle>=360) {
angle -=360;
}
}
Trouble is, when the circles are moving to the right they should always be on the top, and when they are moving to the left they should always be on the bottom.
I think you would need to use levels to get this all to work right, but I am not sure quite how.
I also don't want to have to do this for every circle individually. I think what I want to do is say:
Quote:
When the x coordinate is moving left, level = 0
When the x coordinate is moving right, level = 1
Does anyone know how to do this? Or is there a more efficient way to get it to work.
Thanks!
-Rich
View Replies !
View Related
Stacking Order Issue
Hello, I have a random effect which I need to go BEHIND other elements on the timeline... this actionscript plays infront of everything. How do I get it to play behind other elements? See my problem here: http://www.buzzbbp.com/
amount = 10;
mWidth = Stage.width;
mHeight = Stage.height;
for (var i = 0; i<amount; i++) {
thisFlake = this.attachMovie("flake", "flake"+i, i);
with (thisFlake) {
_x = Math.random()*mWidth;
_y = Math.random()*mHeight;
_xscale = _yscale=_alpha=40+Math.random()*60;
}
thisFlake.yspeed = Math.random()*2+.2;
thisFlake.increment = -0.025+Math.random()*0.05;
thisFlake.radian = 1; //declare for actionscript 2.0
thisFlake.onEnterFrame = function() {
this.radians += this.increment;
//trace(this.radians);
this._x += Math.sin(this.radians);
this._y += this.yspeed;
if (this._y>=mHeight) {
this._y = 0;
this._x = 0+Math.random()*mWidth;
}
if (this._x>=mWidth || this._x<=0) {
this._y = 0;
this._x = 0+Math.random()*mWidth;
}
};
}
View Replies !
View Related
Form Aplication Stacking
Is it possible to have the root level screen play on top of the other screens rather than behind it?
I want to have a screen that stays on top of all the other screens that you look through to see the content of each screen (like looking through a door to see the room behind it).
I'm just not sure what to even look up to research so I can learn this.
I'm much more familiar with the Forms Application side of flash that the traditional side.
View Replies !
View Related
Stacking Order Of Duplicated MCs
I have a Flash piece that duplicates a random number of MovieClips (using duplicateMovieClip) and randomly places them. You can see it here:
http://litmusbox.com/staging2/
Trouble is, the duplicated MCs are being placed on top of other artwork. The duplicates appear on top of the text on the left side of the page. The original MC which is being duplicated resides on a layer that is under this text. However, its duplicates are being placed on top.
See my code attached. I'm not sure how "depth" applies here. From what I can tell, the only time one refers to "depth" is when you're duplicating a movie clip, and that movie clips that have not been duplicated have no way of assigning them depth. I've assigned the new MCs to have a depth of "itr-100". I'm assuming lower depth means lower stacking order. However, these duplicated MCs are clearly appearing on top.
Any ideas?
Attach Code
onEnterFrame = function () {
// create new block
thisName = "block" + itr;
duplicateMovieClip (_root.block, thisName, itr - 100);
// determine location of new block
_root[thisName]._x = (random (19) * 50) + 25;
_root[thisName]._y = (random (5) * 50) + 25;
}
View Replies !
View Related
Stacking Movie Clips
I am using Flash 8 and here is the presentation I am working on:
[L= [L=http://www.elanwebservices.com/clinical_discussion/presentation.html]]http://www.elanwebservices.com/clinical_discussion/presentation.html][/L] [L=http://www.elanwebservices.com/clinical_discussion/presentation.html[/L]]http://www.elanwebservices.com/clinical_discussion/presentation.html[/L][/L]
When you click on each slide button number, everything progresses along without problem. When you click a previous button, things still work fine. But when you start clicking randomly, especially buttons 4 and 5 and then back to 2 and others, the text from one slide begins to stick and show up on other slides and then all the text starts sticking so you have a mess.
How can I prevent this?
I have set all the movie clips of the entire presentation to a visibility of 0 on each slide except for the movie clips I want to display. For example, on slide 5 I have the following ActionScript:
var logo2 = new ImageViewer(this, 3, 572, 32, 193, 49);
logo2.loadImage("images/logo2.jpg");
var egfr_3 = new ImageViewer(this, 6, 40, 149, 350, 360);
egfr_3.loadImage("images/egfr_3.jpg");
// display references in front of the compass image
topDepth = 40;
slide5text_mc.onEnterFrame = function() {
this.swapDepths(_root.topDepth);
++_root.topDepth;
};
container_mc2._visible = 0;
container_mc4._visible = 0;
container_mc5._visible = 0;
container_mc7._visible = 0;
container_mc8._visible = 0;
container_mc9._visible = 0;
container_mc10._visible = 0;
references_mc._visible = 0;
slide2text_mc._visible = 0;
slide3text_mc._visible = 0;
slide4text_mc._visible = 0;
slide6text_mc._visible = 0;
slide7text_mc._visible = 0;
slide11text_mc._visible = 0;
The images are no problem. It's the slide text I converted into movie clip symbols that I am having trouble with.
How can I prevent the slide text movie clips from stacking up on each other?
Thanks in advanced for your expertise (something that I am lacking presently).
John
View Replies !
View Related
Changing Stacking Order
Hi there, first time ever on a forum so please forgive me.
I have an FLA with a section in it where I need to swap between images (one over the other and so on, which I have done using swap depth) what I want to know is if there is a way to make the transition from one pic to the other smoother by using alpha from 100% to zero, thus revealing the picture beneath.
Does anybody out there know how this is done.?
View Replies !
View Related
Stacking Thumbnails In From XML In Flash?
I have this simple xml photogallery script. I have 6 thumbnails and want to stack them 2 thumbnails in each row - giving me a stack of three rows (two thumbnails in each row).
Can somebody tell me how I can do this? I'm kind of stuck....
Here is my code in the flash piece ------ //
myPhoto = new XML();
myPhoto.ignoreWhite = true;
myPhoto.onLoad = function(success) {
numimages = this.firstChild.childNodes.length;
spacing = 70;
for (i=0; i<numimages; i++) {
this.picHolder = this.firstChild.childNodes[i];
this.thumbHolder = thumbnails.createEmptyMovieClip("thumbnail"+i, i);
this.thumbHolder._x = i*spacing;
this.thumbLoader = this.thumbHolder.createEmptyMovieClip("thumbnail_i mage", 0);
this.thumbLoader.loadMovie(this.picHolder.attribut es.thmb);
this.thumbHolder.title = this.picHolder.attributes.title;
this.thumbHolder.main = this.picHolder.attributes.main;
this.thumbHolder.onRelease = function() {
loader.loadMovie(this.main);
title_txt.text = this.title;
};
}
};
myPhoto.load("xmlphoto.xml");
------------------------------------- //
Any guidance would be great. Thanks in advance.
_G
View Replies !
View Related
Stacking And Double Clicking
let say i have a MovieClip name window.
I wanna use stacking order for swap between windows. This is the coding i got from kirupa tutorial:
on (press, dragOver) {
startDrag(_root.window);
}
on (release, rollOut, dragOut) {
stopDrag();
}
on (press, release, dragOver, dragOut) {
_root.x +=2;
_root.window.swapDepths(_root.x);
}
So, the problem is, i also wanna use double clicking for open and close the window partial. How is that possible?
View Replies !
View Related
Stacking Movieclips/BringToFront. Help Please :)
Hey all question time
I have a simple interface which creates "windows" by attaching them at gradually increasing depths to the stage.
Now say I click on one of these windows (I have a listener attached to each), I would like this window to come to the top. I've done this before using swapDepths() but fail to remember how exactly. There can possibly be any number of windows; how can I have the one I click on come to the front?
Much appreciate all ye that can help
View Replies !
View Related
|