[CS3] (AS2) External Swfs & Next Highest Bit Depth
i have a dress up doll on steroids site i am working on
i have the dress-up doll in the main SWF I also have a few other external swfs for the other sections at the moment i am loading the main navigation externally as well.
my problem is this......... if i put the layer that contains the container for the main navigation on top of the layer containing the doll (all in the main swf) my doll gets all wacked out. i think this is because of the animation on the buttons. the main navigation was done in after effects and the animations moves from the left side of the screen to the middle then animates. so its movie clip size causes it to cover the doll so the code does work correctly. if i move the layer under the doll everything works fine but the animation is behind the doll so how do i get the button to the top of the layer stack only when it is playing.. help please
God Bless
FlashKit > Flash Help > Flash ActionScript
Posted on: 07-14-2008, 12:07 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Question About Depth And Highest Depth
Hello hello
I am learning AS and am now at the depth story.
I have questions about it : when I create an empty mc, where different swfs will load in ( loaded on main stage by several movie clips) is it interesting to use the getNextHighestDepth command ??
Thank you action scripters !!!
Highest Depth
I have a button that calls one of my photos but everytime the photo comes the photo hides my button what is the action to keep my button at layer 2 or something like that
Highest Depth
putting a movieclip into highest depth without knowing which clip is in the highest depth
Get New Highest Depth
If I want an object to obtain the highest depth onRelease, which method from the following (or any other) would be the best?
Using a createEmptyMC at highest depth and then swap to with that hight or use DepthManager.setDepthTo() ?
Next Highest Depth In AS3
I have a test FLA with four movie clips that when the user rolls over them I want them to rise to the top, I have some AS2 code for this but I'm struggling to convert it.
Can any one provide me with some sample code?
Thanks
Ricky55
Highest Depth
putting a movieclip into highest depth without knowing which clip is in the highest depth
How To Make Something Highest Depth?
I can't figure out the right syntax to make an object in my movie go to the highest depth. I'm doing this inside a swf that is loaded into my main swf.
This is what I have but it's not working
code:
var nextDepth:Number = this.getNextHighestDepth();
targetClip.swapDepths(nextDepth);
I'm wondering since I'm calling this inside of a loaded swf if I should be using "this"? Not sure why it's not working.
[MX04] Get Highest Depth In A Mc
I have a list that adds mcs dynamically on stage. When I click on a mc it get the depth and name of that mc (ie mc4, depth 4 )
I trying to get the highest depth on stage, so if there 20 mcs, I get depth 20
When I click on a mc, that mc is deleted, I then want to target all the mcs from (ie depth 4) to move up in the Y axcess.
So if theres 20 mcs on stage and I click on 4.
5 to 20 moves up say 100px's
Need help with the bits in red
Found the below code to find the highest depth in a mc but could not get it working. Can somebody help me in understand it
PHP Code:
/* gets the highest depth in a movieclip */
MovieClip.prototype.highestDepth = function(){
var curr, high = undefined;
for (var clip in this){
if (!isNaN(curr = this[clip].getDepth()) && this[clip]._parent == this){
if (curr > high || high == undefined) high = curr;
}
}
return high;
}
Three Mc's To The Highest Depth/level?
hi all,
still wrestling wildly with as3 - i 'do' think it will be worth the migration - but at the moment am trying to get my head around even the simplest of tasks!
okay if i have three mc's on my stage named sprite1 sprite2 sprite3 and i want them to sit above the image wall created by this script how do i do it?
PHP Code:
/*Created by Min Thu http://www.flashmo.com AS3 References and Credits http://blog.papervision3d.org/ http://theflashblog.com/?p=306 http://www.gotoandlearn.com/ http://www.onerutter.com/ http://labs.blitzagency.com/ http://vilebody.wordpress.com/2007/11/29/3d-papervision-plane-events/*/import org.papervision3d.scenes.*;import org.papervision3d.cameras.*;import org.papervision3d.objects.*;import org.papervision3d.materials.*;import fl.transitions.Tween;import fl.transitions.easing.*;import flash.display.Sprite;import flash.events.MouseEvent;var container:Sprite = new Sprite();container.x = 400;container.y = 300;addChild(container);var scene:Scene3D = new MovieScene3D(container);var cam:Camera3D = new Camera3D();cam.zoom = 6;tn_title.text = "";tn_desc.text = "";tn_url.text = "";var p_dict:Dictionary=new Dictionary();var pc:Plane = new Plane();pc.visible = false;cam.target = pc;var numOfRotations:Number = 3;var yPos:Number = 0;var angle:Number = 0;var filename_list = new Array();var url_list = new Array();var url_target_list:Array = new Array();var title_list = new Array();var description_list = new Array();var folder:String = "thumbnails/";var i:Number;var j:Number = 0;var k:Number = 0;var l:Number = 0;var m:Number = 0;var total:Number;var flashmo_xml:XML = new XML();var loader:URLLoader = new URLLoader();loader.load(new URLRequest("thumbnail_list_3.xml"));loader.addEventListener(Event.COMPLETE, create_thumbnail);function create_thumbnail(e:Event):void { flashmo_xml = XML(e.target.data); total = flashmo_xml.thumbnail.length(); var anglePer:Number = ((Math.PI*2) * numOfRotations) / total; for( i = 0; i < total; i++ ) { url_list.push( flashmo_xml.thumbnail[i].@url.toString() ); url_target_list.push( flashmo_xml.thumbnail[i].@target.toString() ); title_list.push( flashmo_xml.thumbnail[i].@title.toString() ); description_list.push( flashmo_xml.thumbnail[i].@description.toString() ); var bfm:BitmapFileMaterial = new BitmapFileMaterial( folder + flashmo_xml.thumbnail[i].@filename.toString()); bfm.oneSide = false; bfm.smooth = true; var p:Plane = new Plane(bfm, 140, 105, 2, 2); scene.addChild(p); var p_container:Sprite = p.container; p_container.name = "flashmo_" + i; p_dict[p_container] = p; p_container.buttonMode = true; p_container.addEventListener( MouseEvent.ROLL_OVER, p_rollover ); p_container.addEventListener( MouseEvent.ROLL_OUT, p_rollout ); p_container.addEventListener( MouseEvent.CLICK, p_click ); p.rotationY = (-i*anglePer) * (180/Math.PI) + 90; p.x = Math.cos(i * anglePer) * 480; p.z = Math.sin(i * anglePer) * 480; p.y = yPos; if( (i+1) % 20 == 0 ) { yPos += 115; } }}function p_rollover(me:MouseEvent) { var sp:Sprite = me.target as Sprite; var tw:Tween = new Tween(sp, 'alpha', Strong.easeOut, 1, 0.5, 0.6, true); var s_no:Number = parseInt(sp.name.slice(8,10)); tn_title.text = title_list[s_no]; tn_desc.text = description_list[s_no]; tn_url.text = url_list[s_no];}function p_rollout(me:MouseEvent) { var sp:Sprite = me.target as Sprite; var tw:Tween = new Tween(sp, 'alpha', Strong.easeOut, 0.5, 1, 0.6, true); tn_title.text = ""; tn_desc.text = ""; tn_url.text = "";}function p_click(me:MouseEvent) { var sp:Sprite = me.target as Sprite; var s_no:Number = parseInt(sp.name.slice(8,10)); navigateToURL(new URLRequest(url_list[s_no]), url_target_list[s_no]);}addEventListener(Event.ENTER_FRAME, render);function render(e:Event):void{ var dist2:Number = ((stage.mouseX) - 400) * 0.0001; angle += dist2; cam.x = - Math.cos(angle) * 150; cam.z = Math.sin(angle) * 150; var new_zoom = 5; cam.zoom += ( new_zoom - cam.zoom ) * 0.06; scene.renderCamera(cam);}
that script creates a scrolling image wall but the wall sits above the three mc's and not at a lower depth.
do i need to create each mc dynamically? something like
sprite1 = newsprite etc...
or can i just say that sprite 1,2,3 should appear at depth 10,11,12?
i also need the mc's to act as a navigation - so if sprite1 is clicked the swf timeline will go to frame2 - and if sprite2 is clicked goto frame3
how do i do these things in as3? i would be able to do it in as2 but i can't work it out for as3 - some much is different! - anyone shed some light for me? please?
Staying At Highest Depth
I have a about 70 movieClips floating about on the stage - all created dynamically using _getNextHighestDepth() to assign depth. The problem is I need a title bar that is always on top of all those movie clips.
The Monkey Wrench: Every 200 frames I create a new clip (a text graphic) and put that over the 70 floaters - using _getNextHighestDepth(). This clip swaps depths with the previous text mc that was there. If I set the title bar to then swap with that it still gets a few of the floaters going over it - but the text graphics ALWAYS stay on top. Why?
Is there a way to always check what the highest depth being used is and then automatically moving a movieclip to that highest depth?
Early on I use:
Code:
_root.createEmptyMovieClip("serviceVals_mc",this.getNextHighestDepth());
this.redV1_mc.swapDepths(serviceVals_mc);
this.serviceTTL_mc.swapDepths(redV1_mc);
The idea is to keep serviceTTL_mc always on top of everything else. Then later I,...
Code:
// Swap new text rectangle with previous
this.redV5_mc.swapDepths(redV4_mc);
// Attach previous value little red rect to newfloater
choiceOfRect = Math.random()*100 + 1;
xballName = "littleRED_3_mc";
_root.attachMovie("littleRED3_mc", xballName, this.getNextHighestDepth());
this.redV5_mc.swapDepths(_root[xballName]);
_root[xballName]._alpha = 35 + (Math.abs(choiceOfRect)/3);
If iI add this to the above...
Code:
this.serviceTTL_mc.swapDepths(this.redV5_mc);
.. it doesn;t work.
Any suggestions?
Next Highest Depth Problem
I'm building a tool that will allow users to draw shapes over another image. I'm importing the image as the background of the stage, and then placing the drawn shapes over that background.
I was successful in importing the background and the shape drawing scripting, however I'm trying to add a control bar over the background image to allow users to choose options before drawing, and I can't figure out how to control it's depth. I placed the control bar on the stage, but it's being hidden by the background image, which is being placed as such:
Code:
var bgImage:MovieClip = this.createEmptyMovieClip("bgImage", this.getNextHighestDepth());
if (!url) url = "http://mysite/image.png";
bgImage.loadMovie(url);
bgImage.moveTo(0,0);
Any tips on how to define the depth of the control bar MC show it will show up OVER the background image?
Thanks in advance you geniuses.
porpoise
Mc's/sprites To Highest Depth~?
hi all,
still wrestling wildly with as3 - i 'do' think it will be worth the migration - but at the moment am trying to get my head around even the simplest of tasks!
okay if i have three mc's on my stage named sprite1 sprite2 sprite3 and i want them to sit above the image wall created by this script how do i do it?
PHP Code:
/*
Created by Min Thu
http://www.flashmo.com
AS3 References and Credits
http://blog.papervision3d.org/
http://theflashblog.com/?p=306
http://www.gotoandlearn.com/
http://www.onerutter.com/
http://labs.blitzagency.com/
http://vilebody.wordpress.com/2007/11/29/3d-papervision-plane-events/
*/
import org.papervision3d.scenes.*;
import org.papervision3d.cameras.*;
import org.papervision3d.objects.*;
import org.papervision3d.materials.*;
import fl.transitions.Tween;
import fl.transitions.easing.*;
import flash.display.Sprite;
import flash.events.MouseEvent;
var container:Sprite = new Sprite();
container.x = 400;
container.y = 300;
addChild(container);
var scene:Scene3D = new MovieScene3D(container);
var cam:Camera3D = new Camera3D();
cam.zoom = 6;
tn_title.text = "";
tn_desc.text = "";
tn_url.text = "";
var p_dict:Dictionary=new Dictionary();
var pc:Plane = new Plane();
pc.visible = false;
cam.target = pc;
var numOfRotations:Number = 3;
var yPos:Number = 0;
var angle:Number = 0;
var filename_list = new Array();
var url_list = new Array();
var url_target_list:Array = new Array();
var title_list = new Array();
var description_list = new Array();
var folder:String = "thumbnails/";
var i:Number;
var j:Number = 0;
var k:Number = 0;
var l:Number = 0;
var m:Number = 0;
var total:Number;
var flashmo_xml:XML = new XML();
var loader:URLLoader = new URLLoader();
loader.load(new URLRequest("thumbnail_list_3.xml"));
loader.addEventListener(Event.COMPLETE, create_thumbnail);
function create_thumbnail(e:Event):void
{
flashmo_xml = XML(e.target.data);
total = flashmo_xml.thumbnail.length();
var anglePer:Number = ((Math.PI*2) * numOfRotations) / total;
for( i = 0; i < total; i++ )
{
url_list.push( flashmo_xml.thumbnail[i].@url.toString() );
url_target_list.push( flashmo_xml.thumbnail[i].@target.toString() );
title_list.push( flashmo_xml.thumbnail[i].@title.toString() );
description_list.push( flashmo_xml.thumbnail[i].@description.toString() );
var bfm:BitmapFileMaterial = new BitmapFileMaterial(
folder + flashmo_xml.thumbnail[i].@filename.toString());
bfm.oneSide = false;
bfm.smooth = true;
var p:Plane = new Plane(bfm, 140, 105, 2, 2);
scene.addChild(p);
var p_container:Sprite = p.container;
p_container.name = "flashmo_" + i;
p_dict[p_container] = p;
p_container.buttonMode = true;
p_container.addEventListener( MouseEvent.ROLL_OVER, p_rollover );
p_container.addEventListener( MouseEvent.ROLL_OUT, p_rollout );
p_container.addEventListener( MouseEvent.CLICK, p_click );
p.rotationY = (-i*anglePer) * (180/Math.PI) + 90;
p.x = Math.cos(i * anglePer) * 480;
p.z = Math.sin(i * anglePer) * 480;
p.y = yPos;
if( (i+1) % 20 == 0 )
{
yPos += 115;
}
}
}
function p_rollover(me:MouseEvent)
{
var sp:Sprite = me.target as Sprite;
var tw:Tween = new Tween(sp, 'alpha', Strong.easeOut, 1, 0.5, 0.6, true);
var s_no:Number = parseInt(sp.name.slice(8,10));
tn_title.text = title_list[s_no];
tn_desc.text = description_list[s_no];
tn_url.text = url_list[s_no];
}
function p_rollout(me:MouseEvent)
{
var sp:Sprite = me.target as Sprite;
var tw:Tween = new Tween(sp, 'alpha', Strong.easeOut, 0.5, 1, 0.6, true);
tn_title.text = "";
tn_desc.text = "";
tn_url.text = "";
}
function p_click(me:MouseEvent)
{
var sp:Sprite = me.target as Sprite;
var s_no:Number = parseInt(sp.name.slice(8,10));
navigateToURL(new URLRequest(url_list[s_no]), url_target_list[s_no]);
}
addEventListener(Event.ENTER_FRAME, render);
function render(e:Event):void
{
var dist2:Number = ((stage.mouseX) - 400) * 0.0001;
angle += dist2;
cam.x = - Math.cos(angle) * 150;
cam.z = Math.sin(angle) * 150;
var new_zoom = 5;
cam.zoom += ( new_zoom - cam.zoom ) * 0.06;
scene.renderCamera(cam);
}
that script creates a scrolling image wall but the wall sits above the three mc's and not at a lower depth.
do i need to create each mc dynamically? something like
sprite1 = newsprite etc...
or can i just say that sprite 1,2,3 should at depth 10,11,12?
i also need the mc's to act as a navigation - so if sprite1 is clicked the swf timeline will go to frame2 - and if sprite2 is clicked goto frame3
how do i do these things in as3? i would be able to do it in as2 but i can't work it out for as3 - some much is different! - anyone shed some light for me? please?
MovieClip Highest Depth?
i checked out the movieclip depth range from depthManager
lowestDepth = -16383
highestDepth = 1048574
reservedDepth = 1048575
but why i can create the movieclip depth higher than reservedDepth??
i got tested it can up to 2130690045 depth, and over reservedDepth will be same as negative depth cannot be remove by removeMovieClip.
How Do I Keep An Object Always At The Highest Depth?
I have a legal disclaimer (symbol text, instance name is internalUseOnly) that must always remain visible in a corner of the stage. It's on the highest layer of the movie, but new objects in child MCs that get drawn or placed on the stage will cover it. How can I control the depth so it's always at the highest level?
I tried assigning a custom class to it (see below), but Flash keeps throwing errors at me. (Including an error that I can't use the this keyword in a class and that I can't use the listener as the method of an object, both of which are baloney. I thought class-based code was supposed to make life easier, not harder.)
Maybe I'm barking up the wrong tree and a custom class isn't the answer. Anybody have an idea?
Here is what does NOT work:
Attach Code
package {
import flash.display.MovieClip;
public class alwaysOnTop extends MovieClip {
addEventListener(Event.ENTER_FRAME, keepTopDepth);
public function keepTopDepth(event:Event):void{
stage.setChildIndex(internalUseOnly, stage.numChildren-1) ;
}
}
}
Edited: 02/03/2008 at 09:22:41 AM by tunghoy
Mouse Cursor At Highest Depth
I built a drawing application, and use custom cursors while they are drawing. What I'd like, is to always have the cursors above the objects drawn, instead of what its doing now, which is hiding behind the objects. I tried sawpping depths with the last objects drawn, so it would always be on top, but it caused a bug that would make one of the other functions not work properly on occassion.
So I was just wondering if there is any way to set an object already created to the next highest depth?
Setting A Movieclip To The Highest Available Depth
Hi,
I am making a website where I have some thumbnails of images on the first page itself.
These thumbnails are all individual movieclips, acting as buttons....
When a user clicks over a particular thumbnail, the playhead goes to the fourth frame(of that movieclip) and loads a new movieclip (the full version of that thumbnail) already placed at that frame. And as soons he clicks on it again, the playhead comes back to the 1st frame....
Now the problem I am having is that I am not able to place the currently clicked thumbnail's movieclip to the highest depth....such that when the third thumbnail is clicked and the its bigger version is loaded at 4th frame, the previous two thumbnails are overlaying it due to the depth problem....
I am new to depths, and pls help me out to solve this problem...
Thanks.
Send Buttons To Highest Depth? Help
Hiya,
I'm not sure how I would bring my buttons to the highest depth. I just finished the Kirupa slideshow, but the only prob is that the pics keep hiding my buttons. I've been at it for hours and hope someone here could give me a hand
Load Random Clips Into Highest Depth
(using flash cs3, as2 - fla attached)
i have a button,
when "1" is pressed it loads a random swf from an array into the next highest depth.
everyone time "1" is pressed it load a new random swf, but the previous swf loaded is removed.
how do i get each new random swf to load ontop of the previous one when "1" is pressed, like a never ending stake of cards?
i have used getNextHighestDepth, i expcted it to load the next random swf into a new movieclip infront of the previous ones, but it seems to load it into the same movieclip.
thanks
Chris
Setting Display Objects To The Highest Depth
Say I have a number of buttons placed on my stage. On roll over - I want this button to expand along both x and y axis. So I want my button to be on top of all the other buttons - otherwise there is high risk that the other buttons will lie on top of my expanded button.
I have found a quick and dirty solution:
ActionScript Code:
private function onMyButtonOver(e:MouseEvent)
{
removeChild(DisplayObject(e.target));
addChild(DisplayObject(e.target));
}
In the old days you would use getNextHighestDepth to be sure to put something on top. The solution above works but I find it kinda ugly. Any thoughts?
Move A MC To Highest Level/depth Without SwapDepth
Flash5.
I have 3 MC.
on release I want the MC (linked to that particular button) to move to a/the depth/level higher than the other two MC's.
on the next release, that particular MC should move again over the other two
et cetera.
So like Swapdepth, with the difference that I do not want two MC's swapping depth.
The new image should always go on top of the previous highest positioned image.
Is this possible and if so, how?
Thanks!
How Can I Load A Movie To The Highest Depth(level)?
hi
these tutorials are cool
I hope you guys help me out on this.
I'm trying to load an external mc to my web page, I have randomly
flying stars on my page that's why I want to load my mc to the highest
depth(highest level )
thanks
How To Move A MC To The Highest Level/depth Without SwapDepth (flash5)
Flash5.
I have 3 MC.
on release I want the MC (linked to that particular button) to move to a/the depth/level higher than the other two MC's.
on the next release, that particular MC should move again over the other two
et cetera.
So like Swapdepth, with the difference that I do not want two MC's swapping depth.
The new image should always go on top of the previous highest positioned image.
Is this possible and if so, how
Thanks!
External Movie Loading At Highest Level
Hi.
I have two buttons loading two separate external .swf files into a movie container. When they come in, they play over the navigation. Do you know why this is happening? The navigation buttons reside on layer 2 and layer 3 on the timeline on top of the container. My "container" resides on layer 1 on the timeline. This is the AS code on layer 4 of the timeline:
Attach Code
btn1.addEventListener(MouseEvent.CLICK,loadImage);
btn2.addEventListener(MouseEvent.CLICK,loadImage)
function loadImage(e:MouseEvent){
var IMGPath:URLRequest;
switch(e.target){
case btn1: IMGPath = new URLRequest("test1.swf");
break;
case btn2: IMGPath = new URLRequest("test2.swf");
break;
default: trace("Error: loadImage called by unknown button");
break;
}
var IMGLoader:Loader = new Loader();
IMGLoader.load(IMGPath)
IMGLoader.x = 0
IMGLoader.y = 0
addChild(IMGLoader)
}
Edited: 09/02/2008 at 12:31:25 PM by zero7ven
Transitions Between External SWFs - Looks Crap As The Size Of External SWFs Grow
http://www.kirupa.com/developer/mx2004/transitions.htm
regarding this tutorial I started my site (http://technoportsolutions.com/technoflash/) to get some trasition effects but im getting somewhat different since the external SWFs take time to load. isn't it better to create "intro and outro" on the same time line instead of loading external SWFs bcos once the movie loaded as a whole will lead to smooth and contineous transitions. If anyone ever did something better or how can I use some transition effects (like intro and outro) without using external SWFs ? is my current problem.
Transitions Between External SWFs - Close Button For External Swfs
I recently created a site using the "Transitions between External SWFs" tutorial for Flash MX 2004. I use this to load the sections of my site into the main movie file. Each section is an External SWF file. When a viewer clicks on a navigation button, the specific external swf move will load and play. Currently, a viewer would need to click on another navigation option to close the current external swf file. I would like to add a close button to each of the external swfs so that a view has the option to close the window without clicking on a naviagtion link. Anyone have any suggestions? I am fairly new to actionscript and not quite sure how to accomplish this.
Thanks in advance for you help!
-RhynoDesign
Path Depth And Variables Between Loaded .swfs
Hi,
I've been stumped for way too long so I'm hoping someone here knows what the problem might be with this file...
To understand the problem, you have to know the structure:
_level0 is a movie that holds all of the navigation.
_level0._root.object is an MC that holds all loaded .swfs (the guts, the content)
I have a button in _level0 with a text field that changes depending on the content that is loaded into _level0._root.object. This text field MUST be two levels deeper than root in order for it to be part of the interactivity within the navigation of _level0. (My draggable window panels, navigation palettes)
The text field changes when a button in _level0._root.object has been pressed. I do this by calling a function which sits in _level0 on the _root. The function is as follows (with 'blah' as placeholder for field variable name):
Code:
function fillField () {
_level0._root.nav.nav2.blah = "BLAHBLAH";
}
There's more to it but I removed the unimportant parts.
My problem is: The field will not fill if it is any deeper than _level0._root. So, the code above does nothing, even if the field is sitting in the nav2 mc. If the field were in the _root and I had this in my function:
Code:
function tempBack () {
_level0._root.blah = "BLAHBLAH";
}
...it works great. BUT I need the field to sit two levels deeper in order for it to drag with my windows and stuff.
Does anyone know why it won't work when I take it off of _root?? My field's variable name is even set to the path above (ideally _level0._root.nav.nav2.blah). Is it a limitation of flash or haha maybe it's me!! I owe you one if you can solve this.
Thanks,
Jessica
Loading External Swfs Into Externally Loaded Swfs.
ive got some buttons on my main timeline that im using to load external swfs into an empty mc. the buttons are coded with the following:
on(release){
if(_root.currMovie == undefined){
_root.currMovie = "1";
emptyMC1.loadMovie("1.swf);
} else if (_root.currMovie != "1") {
if (emptyMC1._currentframe >=
emptyMC1.midframe) {
_root.currMovie = "1";
emptyMC1.play();
}
}
}
1.swf also has some buttons that load external swfs into a second empty mc. those buttons are coded with the following:
on(release){
if(this.currMovie == undefined){
this.currMovie = "2";
emptyMC2.loadMovie("2.swf");
} else if (this.currMovie != "2") {
if (emptyMC2._currentframe >=
emptyMC2.midframe) {
this.currMovie = "2";
emptyMC2.play();
}
}
}
1.swf loads into emptyMC1 ok, and 2.swf loads into emptyMC2 ok.
when i press any of the buttons on the main timeline, the outro animation of 1.swf plays correctly, but the outro animation of 2.swf does not. is there a way to the buttons so that the emptyMC's unload sequentially?
Multiple External Swfs With Other Swfs In Them
Hey guys,
I am probably the newest guy here to use flash so please bear with me.
I am making a site for myself and my buddies. Well I want to have a music player on the site at all times. All im going to do for now is just play one mp3 so its not that complicated but while reading Kirupa's tuturial about adding music it said that you need to have more than one swf for the player to work.
My question is...how can I load multiple swfs in one main swf.
so this is what i want:
music player loaded at all times, and other swfs loaded whenever a person navigates through the site.
please help me out.
Thanks in advance.
p.s.Sorry if this is a dumb or simple question.
Multiple External Swfs With Other Swfs In Them
Hey guys,
I am probably the newest guy here to use flash so please bear with me.
I am making a site for myself and my buddies. Well I want to have a music player on the site at all times. All im going to do for now is just play one mp3 so its not that complicated but while reading Kirupa's tuturial about adding music it said that you need to have more than one swf for the player to work.
My question is...how can I load multiple swfs in one main swf.
so this is what i want:
music player loaded at all times, and other swfs loaded whenever a person navigates through the site.
please help me out.
Thanks in advance.
p.s.Sorry if this is a dumb or simple question.
External Png Depth
How would I fix this code so that it doesnt overlap the movieclips on the main timeline?
var container:MovieClip = this.createEmptyMovieClip("container", this.getNextLowestDepth());
var mcLoader:MovieClipLoader = new MovieClipLoader();
var listener:Object = new Object();
listener.onLoadProgress = function(target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void {
_root.preloaderloadermc.preloaderloader.setProgres s(bytesLoaded, bytesTotal);
if (bytesLoaded >= bytesTotal){
_root.preloaderchest._visible = true;
}
}
listener.onLoadInit = function(target:MovieClip):Void {
trace(target + ".onLoadInit");
}
var container:MovieClip = this.createEmptyMovieClip("container", this.getNextHighestDepth());
var image:MovieClip = container.createEmptyMovieClip("image", container.getNextHighestDepth());
var mcLoader:MovieClipLoader = new MovieClipLoader();
var listener:Object = new Object();
listener.onLoadProgress = function(target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void {
_root.preloaderloadermc.preloaderloader.setProgres s(bytesLoaded, bytesTotal);
}
mcLoader.addListener(listener);
mcLoader.loadClip("C:/Documents and Settings/Anderson/Desktop/preloaderbg.png", container);
stop();
Also it would be very kind if you could point out any ways to make this shorter or easier to read, thank you
Swap Depth Of External Swf
hi everyone does anybody have an idea on how to swap depth of an external movie within the main movie..?
......it would be a great help if anyone can help me thanks ahead....
Depth Problem With External MC's
Hi all,
I truly hope somebody may be able to help as I'm well and truly stuck at the moment.
Summary I have three SWF's which comprises of a preloader.swf, and A.swf and B.swf for simplicity sake.
If you can imagine A.swf has the foreground contents and B.swf the background so ideally I would like A to sit on top of B.
In the preloader.swf I have in the first frame the following:
Code:
loadMovieNum ("B.swf", 1)
and frame #2 I have:
Code:
loadMovieNum ("A.swf", 2)
So far so good...as the foreground A.swf sits on the background B.swf. The only fly in the ointment is that in terms of the A.swf I had set a number of setMasks on the main timeline for the content...such as:
Code:
a.setMask(mask);
mask.duplicateMovieClip ("maskB",2);
B.setMask(maskB);
//etc etc
Whats happened is that now none of these masks function when called from the Preloader.swf. Its as if the depths of each set mask no longer function. I've tested the original version and it works fine.
Now ordinarily I don't use scenes but the external SWF preloader example that I used as my base has the following code on both A and B.swf in the first frame!
Code:
//the usual getBytesTotal beforehand
//Scene 2 is where all the content is meant to go.
ifFrameLoaded ("Scene 2", 1) {
stop();
_level0.nextFrame ();
}
something is going wrong somewhere along the line...I'm not too sure whether the combination of codes outlined are conspiring to to turn my brain into mush!
Hope somebody can help me. One of the other forum boards mentioned the possibility of putting each swf into an emptyMC on its own level but alas I may have been doing something wrong because all I got was a blank test screen .
Any help would most appreciated
Unloading External Swf Using Depth
hi all,
i have a main.swf which has the syntax that loads an external swf:
Code:
loadMovieNum("http://www.mainwebsite.com/pop_up.swf", _root.getNextHighestDepth());
the main.swf is on one server while the external swf named pop_up.swf is on another. By using that syntax shown the pop_up.swf has no problem showing up ontop of the main.swf.
Problem is now to get the pop_up.swf to unload using a button placed in pop_up.swf, i have obviously tried this using levels but it dosent seem to be working.
So guessing i will have to do it using depths in the same fashion as it was loaded on.
any ideas how to do this?
any help or advice will be much appreciated
Bigbalroo
Load External .swf Into A 2 MC Depth Target
Hi!
I'm tryin to load an external .swf ("load.swf") into a movie clip ("second") placed into another movie clip("first").
I'm trying this script for a button:
on (release) {
_root.first.second.loadMovie("load.swf", 1);
second._x = 12 ;
second._y = 50 ;
}
The problem is that "load.swf" is loaded but:
1) It's top-left corner is aligned with "second" center
2) "Second" is completely replaced by "load.swf"
3) I can't move the loaded file using the ._x ._y parameters
What I need is to load the external .swf into a 2 MC depth target and:
1) Align it's top-left corner with the container MC ("second") top-left corner
2) See "second" behind the loaded .swf
I've just read this article ( http://www.kirupa.com/developer/mx/loading.htm ) but I can't figure it out.
Any idea?
Thanks a lot.
Setting Depth To An External File
hey FK!
as usual, i am on the path of the learning as3.
here is my question for today? can you set the depth of an externally loaded file?
ex.
I have an image gallery (which is external) loaded into my main app. when you click an image it opens a "pop up" where the image is displayed. in my main app, there are some other elements that i would like to show on top of my image "pop up". so i am trying to figure out how to set the image to go back a step... any ideas?
Generic Preloader For External Swfs From Within An External Swf
Hi,
I have a full flash site that has a main interface.swf that loads in external swf's as holders for their relevant page contents. E.G. using loadMovie I load portfolio.swf into the mainLoader (movieclip) within interface.swf. Within portfolio.swf I load in a further series of external swf's based on button click events, for these I want to use a generic preloader to prevent having to put a preloader in each individual swf.
I have found some code on O'Reilly (http://web.oreilly.com/news/action_0501.html) which seems to offer what I need but I'm having problems implementing this, I'm pretty sure this is down to incorrect targeting due to the fact I am not preloading from _root.
This is what i've been working with:
code:
// ON THE MC I'M LOADING INTO
onClipEvent (enterFrame) {
// If the host clip contains an external .swf file...
if (this._url != _root._url) {
// ...call our preload() function, which displays the
// loading .swf file's download progress.
_parent.preload(this);
}
}
// AND THE PRELOAD FUNCTION ITSELF
function preload (theClip) {
if (!theClip.doneLoading) {
// If we have all the frames, make a
// note that download is complete.
if (theClip._framesloaded > 0
&& theClip._framesloaded == theClip._totalframes) {
theClip.doneLoading = true;
// Optionally start the clip once it's done loading...
// theClip.play();
} else {
// Optionally pause the clip until it's loaded...
// theClip.stop();
}
// Display loading byte counts in text fields.
bytesLoadedOutput = theClip.getBytesLoaded();
bytesTotalOutput = theClip.getBytesTotal();
// Strip out the file name of the .swf loading into the
// clip and display it in a text field.
var lastSlash = theClip._url.lastIndexOf("/");
clipURLOutput = theClip._url.substring(lastSlash + 1,
theClip._url.length);
// Set the width of the loading bar.
var percentLoaded = (theClip.getBytesLoaded()
/ theClip.getBytesTotal());
preloadBar._width = preloadBarBG._width * percentLoaded;
}
}
When testing the preloader never seems to get started, my movies just play and seem to ignore this code.
Any ideas would be much appreciated.
Loading External Swfs From An External Swf
im building a site that uses a simple AS to load "contact us.swf" into the main movie. my question is how can i code it that from "contact us.swf i can load another external swf such as "form.swf"? i cant get it to load the form heres the code im using
from the mainmovie
on (release) {
_root.contents.loadMovie("contact us.swf");
in the contact movie
_root.contents.loadMovie("formswf");
any suggestions?
Problem About Depth Of Objects..(swap Depth) Plse.help
umph..hello i'm nameg sir
i'm trying to do dragging project. drag isomatric object in small room(isomatric view too) for test installation..(so i necessary have foreground objects,background objects ..u know)
now i can drag many objs. in same movie when i press it , by i use swap depth command (for see it above other)and drag it around sometime it works...but sometime it don't!...
1..... some obj. automatic swap its depth! when i release other one....i don't know why
2. some time i dup. new obj. to drag and it del some old obj. that call before
ps. i use swap code from this site tutorial ...s.a.Drag & Drop / Swap DepthsAuthor by : estudioworks
thank u so muchhhhhhhhhhhhh
External Swfs
Is there a why to load external swfs, while the main movie is playing, so that there is no delay when the external swf is loaded.
I would rather not load them all at once in the preloader for the main movie. Basicly load them "behind the scenes" so that the user does not event know about it.
External Swfs
Hello
This should be simple but I can't find a way of doing it
I'm loading swf's into the same empty mc on button releases.
The first swf needs to load itself when the main site/swf (the
one containing the empty mc) loads initially.
on load main movie > load "first_external_swf.swf > into placeholder
thanks in advance
Paul in sunny Manchester
External .swfs
I am loading external .swfs into my movie and the importing works fine and so does everything else. I can't seem to figure out though why, when I load a freakin' 5kb movie it makes my main movie lag and go slower..any ideas? It's like it's lagging or something and I can't figure out why..But when I haven't loaded the movie everything runs dandy, and even when I'm not loading a external .swf file, and I publish my movie and look at in a browser, the whole clip is slowwed down and is jaggity..can anyone help me or is this just some kind of glitch?
External Swfs & Nav
So I have an empty movie clip on the stage on the main timeline. I have an external swf (call it "movieOne") that loads into the empty movie clip. So far so good. But then I want to have a button in the external swf load a different external swf (call it "movieTwo") into the same "empty movie clip" on the stage of the main timeline.
So I figure that I have to put a loadMovie action on the button in movieOne telling it to load movieTwo into the same container (empty movie clip) on the main timeline. Looking for any help, please and thank you.
External Swfs Necessary?
If I create a scroller for text, images, etc do I have to use external swfs for the content? I ask because I see this so commonly with the swf movies for creating scrollers.
External Swfs
Hi, i'm using loadMovie to load external swfs and jpgs into a target movieclip on the stage, and I really want to get the loaded images to move across the screen. I've animated the target movieclip into which the external swfs and jpgs are being loaded, and this works fine for jpgs (ie, they move across the screen). But the swf files don't move, they just appear and stay put. Any thoughts why?
thanks, jon
Help With External SWFs
i have everything working correctly, but one problem. when you go to my site and you load an external SWF, everything is fine - works just how i want to. the preloader comes in, counts and the bar works. but if you navigate away from that scene after it has been completely downloaded and go back to the previous scene, the external SWF has to reload again. it is a huge pain in the ass for my site goers to have to sit through that again.
is there anyway that i can tell my movie to not reload once it is already loaded?
here is my preloader scripting...myLoaded = Math.round(getBytesLoaded());
myTotal = Math.round(getBytesTotal());
myPercent = myLoaded/myTotal;
myBar._width = myPercent*200;
myText = Math.round(myPercent*100);
if (myLoaded == myTotal) {
gotoAndStop(3);
} else {
gotoAndPlay(1);
}
any help would be greatly appreciated...
thanks in advance
Edited: 04/07/2007 at 08:44:06 PM by jessem1985
Gap Between External Swfs
Hello. I currently have a website built that is very large in size, so I plan on breaking up the background animations and saving them as separate swfs. This works fine, but causes a second or 2 gap when there is no image in the background. What I tried: when you click a button that goes to load the next bakground image, it plays a transition out of the current movie and then plays the new one. This works, but the gap between swfs is still there. Does anyone have a solution for this...can I load all the swfs while the rest of the site is playing, or have the new swf begin loading as soon as the button is clicked so after the transition out of the first one, the second one is ready to play?
Thanks in advance for any help on this...
Help With External Swfs
Hi all!
Just hit a roadblock-- I've got my main timeline with a nav that opens up external .swfs in an empty movieclip on the main stage, and that works wonderfully, but WITHIN those .swfs I'm trying to loadMovie separate .swfs for each button that opens up an input text box that dominates the screen.]
When I loadMovie, I load it into an empty mc not on the main timeline, but on the loaded swf's timeline, so when I test the .swf, not the main timeline, it plays the nested .swf within this swf, but then when I test the main document, when I click the button it doesn't pull it up.
I initially tried to just do it with movieclips inside the swf, but they didn't overlap one another and I couldn't figure it out so I thought loadMovie would work better.
I'm assuming it has something to do with levels, and I've been scouring the forums for something that helps but I can't pinpoint it. ANY HELP IS APPRECIATED!
External SWFS From Within MC
Hey guys. I made a site that has buttons within are animated as a part of a movie clip. I am trying to change the AS to call for these external swfs into the "container" which is of course outside the movie clip button.
here is what the button would call for if outside the movie clip:
on (release) {
if (_root.currMovie == undefined) {
_root.currMovie = "gallery";
container.loadMovie("gallery.swf");
} else if (_root.currMovie != "gallery") {
if (container._currentframe>= container.midframe) {
_root.currMovie = "gallery";
container.play();
}
}
}
the only AS that is in the button movie now is:
on (rollOver) {
this.gotoAndPlay("over");
}
on (rollOut) {
this.gotoAndPlay("out");
}
any ideas? Thanks very much for your help and time!
|