[F8]Using A Loaded Swf's Asset On Another Level
Hi,
I am developing a compositional engine in modules, each module provides a different element to the engine.
Current hierarchy is:
Engine.swf
|
+----------ColorStripper.swf (provides array of available colors)
|
+----------PlotterPanel.swf (provides array of usable coordinates)
|
+----------Assets.swf (provides assets, and an array of linkage properties for available assets)
When I use attachMovie inside of the assets.swf file it works correctly, but when executed in engine.swf to attach movieClips exported inside of assets.swf it does not work.
For example (code inside of engine.swf): while trace(_global.assets[0]) will trace "dropObj" (a string which is a correct linkage property to a movieClip inside of assets.swf)
obj = attachMovie(_global.assets[0],"asset"+i,i);
trace(obj);
will trace "undefined"
is there any way to attach a movieClip loaded into assets.swf (_level3) with code being executed in engine.swf (_level0)?
the goal is to make the asset libraries swappable and independant, while the engine stays the same.
FlashKit > Flash Help > Flash ActionScript
Posted on: 10-30-2006, 02:26 PM
View Complete Forum Thread with Replies
Sponsored Links:
Resizing A MC According To The Loaded Asset (jpg, Swf...)
Hi,
I have tried many things but when i load my external jpg inside a MC (thru the use of a MovieCliploader which then load the jpg inside that MC in an empty MC).
I have put my code in the onLoadInit() and did something like
MC._width = target._width;
My MC has a specified width and height in the library. is it because of that or should i put it smaller.
View Replies !
View Related
Using An Exported Asset In A Loaded Swf
Assume this scenario: SWF A loads SWF B. In SWF B is a library movieclip which has its linkage set for "export for actionscript". After it's loaded into SWF B, is there a way from SWF A to create a new class of this library movieclip (residing in SWF B's library?)
View Replies !
View Related
Determining If An External Asset Is Loaded
Hi, thanks in advance for at least trying to help me... here is my dilemma:
My site is a portfolio of my work, it loads all of the data dynamically out of an XML file, for each client node there are attributes such as photo1="print/inner-1.jpg"
I want the button that links to that image to load in to 50% opacity and then finish when it can tell that the image is fully loaded.
The problem is, for some reason it always views the external asset as 0kb therefore it thinks its already loaded. Any idea why? I was kinda thinking maybe theres a delay between when it sees the image and when it knows its total size?
for reference, my incomplete site is at http://work.haptic-data.com
View Replies !
View Related
Runtime Loaded Asset Seems To Have No Definition
Hi,
one of you forum readers might get the title for "AS-Guru of all time" pointing me the solution to THIS:
I'm publishing an SWF file on domainA and loading every graphical assets and included classes from another SWF located on domainB.
It's great.
Locally.
I mean that when the two files are loaded locally side by side, everything rolls fine.
As soon as I'm trying to load the assets library from domainB, I get a runtime error #1009 (null object reference).
The following "crossdomain.xml" is hosted on domainB :
Code:
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*" />
<allow-access-from domain="localhost" />
<allow-access-from domain="127.0.0.1" />
</cross-domain-policy>
but doesn't seems to accept remote serving of an SWF from another.
I worked my way around security issues by declaring in the first frame of the library SWF
Code:
Security.allowDomain("*");
(now that's security...)
and the library assets gets loaded fine from domainB, like this:
Code:
var path:URLRequest = new URLRequest(Config.SERVER_PATH + "assets/assets.swf");
var context:LoaderContext = new LoaderContext(true, ApplicationDomain.currentDomain);
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onAssetsLoadComplete);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onError);
loader.load(path, context);
Or do they?
The classes associated with the linked library assets gets loaded fine too, as I can instantiate them.
The thing is every time there's a sub-clip inside one of them, it doesn't seem to get defined at all.
For instance, I have SimpleButton called "replay_btn" inside a movieClip linked with "OptionsButtons" class.
I have this
Code:
public var replay_btn:SimpleButton;
in the class definition.
I repeat : this is working fine when
Code:
Config.SERVER_PATH = ""
not anymore when
Code:
Config.SERVER_PATH = "domainB"
Winners might get recognition.
A whole lot'of'it.
I know many chicks.
Please help.
View Replies !
View Related
Determining If An External Asset Is Loaded
Hi, I'm in the middle of creating a portfolio site and I'm almost done, but there is one kink I still can't work out.
My site loads client and picture data out of an xml file each picture is then loaded into a movie clip. And if there are say 4 images, then there are 4 buttons to go to each, I want each button to stay at 50% opacity until it can tell that the jpeg is loaded, but unfortunately it always sees the movie clip as 0 bytes and therefore already thinks its loaded.
I was thinking maybe this was due to a delay between when the asset is set up and when the asset's size is known, but no matter what I can't get the jpeg's file size to ever appear as anything other than 0kb (even if I add a loop until the total size is more than 0).
So my question is:
How can I get flash to see the actual file size of the movie clip with the image and determine if it is loaded?
Thanks in advance!
View Replies !
View Related
Runtime Loaded Asset Seems To Have No Definition
Hi,
I'm looking for a way to make THIS work:
I'm publishing an SWF file on domainA and loading every graphical assets and included classes from another SWF located on domainB.
When the two files are loaded locally side by side, everything works fine.
As soon as I'm trying to load the assets library from domainB, I get a runtime error #1009 (null object reference).
The following "crossdomain.xml" is hosted on domainB :
Code:
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*" />
<allow-access-from domain="localhost" />
<allow-access-from domain="127.0.0.1" />
</cross-domain-policy>
but doesn't seems to accept remote serving of an SWF from another.
I worked my way around security issues by declaring in the first frame of the library SWF
Code:
Security.allowDomain("*");
and the library assets gets loaded fine from domainB, like this:
Code:
var path:URLRequest = new URLRequest(Config.SERVER_PATH + "assets/assets.swf");
var context:LoaderContext = new LoaderContext(true, ApplicationDomain.currentDomain);
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onAssetsLoadComplete);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onError);
loader.load(path, context);
Or do they?
The classes associated with the linked library assets gets loaded fine too, as I can instantiate them.
The thing is every time there's a sub-clip inside one of them, it doesn't seem to get defined at all.
For instance, I have SimpleButton called "replay_btn" inside a movieClip linked with "OptionsButtons" class.
I have this
Code:
public var replay_btn:SimpleButton;
in the class definition.
This is working fine when
Code:
Config.SERVER_PATH = ""
not anymore when
Code:
Config.SERVER_PATH = "domainB"
Help, I'm out of ideas...
View Replies !
View Related
Loaded Asset + Center Anchor Point
Hey there- Question. If i load an asset on stage via a class, how do I center the anchor point of the loaded clip?
Basically, I want to move a .gif image on the stage, and bounce it whenever it hits the boundaries of the stage. The Bouncing.as below adds the ball to the stage and moves/bounces it according to stage height and width and the ball while taking into account the assets radius. The Ball.as class is where the .gif asset is loaded. Seems everything works, but the anchor is fixed at the top-left corner of the loaded clip so the image bounces illogically. I'm assuming it would work perfectly if I could center the anchor point.
Thanks, any help is appreciated!
Bouncing.as:
Code:
package {
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
public class Bouncing extends Sprite {
private var ball:Ball;
private var vx:Number;
private var vy:Number;
public function Bouncing() {
init();
}
private function init():void {
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align=StageAlign.TOP_LEFT;
ball = new Ball();
ball.x = stage.stageWidth / 2;
ball.y = stage.stageHeight / 2;
vx = Math.random() * 10 - 5;
vy = Math.random() * 10 - 5;
addChild(ball);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function onEnterFrame(event:Event):void {
ball.x += vx;
ball.y += vy;
var left:Number = 0;
var right:Number = stage.stageWidth;
var top:Number = 0;
var bottom:Number = stage.stageHeight;
if(ball.x + ball.radius > right) {
ball.x = right - ball.radius;
vx *= -1;
}
else if(ball.x - ball.radius < left) {
ball.x = left + ball.radius;
vx *= -1;
}
if(ball.y + ball.radius > bottom) {
ball.y = bottom - ball.radius;
vy *= -1;
}
else if(ball.y - ball.radius < top) {
ball.y = top + ball.radius;
vy *= -1;
}
}
}
}
Ball.as
Code:
package {
import flash.display.Sprite;
import flash.display.Loader;
import flash.net.URLRequest;
public class Ball extends Sprite {
public var radius:Number;
public var vx:Number = 0;
public var vy:Number = 0;
public function Ball(radius:Number=0) {
this.radius = radius;
init();
}
public function init():void {
var loader:Loader = new Loader();
addChild(loader);
loader.load(new URLRequest("promo.gif"));
}
}
}
View Replies !
View Related
Why Are Buttons On A Lower Level Still Active In A Loaded Higher Level...?
hi, i'm very new to flash and am in the midst of trying to figure out the loadMovieNum feature. I have the one swf loading into a higher level (say 10) but the buttons on the level below it are still active (ie you get the little hand if you roll over them) even though they are no longer visible. I tried loading all levles into 0, but that means the page below goes away entirely and i like having the preloader of the next page pop up over the current page. I've tried just loadMovie into an empty MC but get the same result. Can anyone help?
thanks in advance!!
View Replies !
View Related
Quiz Template Not Computing Score When Loaded Into A Level Other Than Level 0...
I have created a 10 question multiple choice quiz from the quiz template, and it works perfectly as its own .swf. But when I use the moviecliploader object to load the quiz .swf into another .swf in level 5 (or any other layer other than 0) I am able to go through all of the questions and get the correct feedback, but when the results frame shows up, nothing gets computed. Does anyone know what I should do to allow this to work? Thanks.
View Replies !
View Related
Play Movie In Level 0 From Loaded .swf On Level 10?
hi everyone...
i have a movie(frame2) on the main timeline of the the main .swf loaded in at level 0, Which i want to play by clicking a button in a movie on the main timeline of .swf loaded in on level 10 what actionscript do i need to do this, i have looked at several other answers on the message board but none seemed to be relevant any body know what the script should be that i attach to the button.????your help would be much appreciated...
View Replies !
View Related
Playing A Loaded Movie Clip (loaded In A Different Level)
I really don't understand the problem here, I'm loading a swf containing a movie clip with 2 frames with Stop(); on each. The file is loaded on _level5 so I tried this:
Code:
tellTarget (_level5.musicmc) {
gotoAndStop (2);
}
but instead of telling the musicmc movieclip to go to frame 2, it tells it to the main timeline to go to frame 2 and stop...What's the problem, when I use "Debug Movie", I can see the:
_level5
......._level5.musicmc (....... = spaces)
what's wrong, it seems to don't want to tell the MC to go to frame 2. I passed many hours on this simple d*mn thing and I really can't find out...
BTW, I'm using Flash 5
View Replies !
View Related
Attaching Asset To A Class, And Maybe Class To An Asset? (Flex AS3)
Hey everybody!
I've posted this question in other flex and actionscript-centered forums, but got no answers so I thought it couldn't hurt if I asked it here. The post is long because I'm trying to express the problem with as much detail as possible, so bear with me
I'm somewhat new to Flex, coming from Flash CS3, so I'm most familiar with the Library paradigm and trying to port that knowledge to Flex. Here's a specific problem that I'm having...
I know you can attach embedded asset symbols to a full fledged class, similar to defining Linkage in Flash CS3. I'll be using a typical login dialog box to demonstrate this problem. Imagine that the Artist gave me an assets.swf that contained a LoginModule movieclip with a textfield for username input, a textfield for password input, and a button movieclip for clicking. I attach the LoginModule asset like so:
Code:
package ui.modules{
import flash.display.Sprite;
[Embed(source="/../assets.swf#LoginModule")]
public class LoginModule extends Sprite{
public var usernameTxtbox:TextField;
public var passwordTxtbox:TextField;
public var loginBtn:MovieClip;
public function LoginModule(){}
}
}
Works great like this! However.... I would like to have that particular login button behave like yet another class I have written, called CustomButton. All CustomButton is is a MovieClip with 2 frames, stopped at the first frame, but will move to the second upon mouseover:
Code:
package ui.controls{
import flash.display.MovieClip;
import flash.events.MouseEvent;
public class CustomButton extends MovieClip{
public function CustomButton(){
gotoAndStop(1);
addEventListener(MouseEvent.MOUSE_OVER,onMouseOver);
addEventListener(MouseEvent.MOUSE_OUT,onMouseOut);
}
private function onMouseOver(e:MouseEvent):void{
gotoAndStop(2);
}
private function onMouseOut(e:MouseEvent):void{
gotoAndStop(1);
}
}
}
This is where I'm stumped.
If the Artist gave me the asset.swf with that LoginModule clip with a button already attached, trying to force loginBtn in LoginModule to be a CustomButton using loginBtn:CustomButton would throw an error. In Flash, all I had to do was set the Button's Base class to ui.controls.CustomButton, but at this time it seems my only option is to ask the Artist not to include the button in the LoginModule, and allow me to include the loginBtn manually as a CustomButton. This would greatly hamper the Artist's duties, so I'd like to solicit some advice from the gurus out there: How do you handle situations like these?
Thanks for any and all help!
Jay
View Replies !
View Related
Movies Loaded On Level 1 Don't Disable Movies On Level 0
ok my problem is that i have a main movie playing and i load a new movie over it; the problem is that the links (buttons) on the older movie is still active; so how do i disable the buttons on the older movie; give focus only on the new movie and return to the older movie when i have unloaded the new movie ..... if anybdy unerstood my problem pls tell me; how can i fix this
Jerry
View Replies !
View Related
Movies Loaded On Level 1 Don't Disable Movies On Level 0
ok my problem is that i have a main movie playing and i load a new movie over it; the problem is that the links (buttons) on the older movie is still active; so how do i disable the buttons on the older movie; give focus only on the new movie and return to the older movie when i have unloaded the new movie ..... if anybdy unerstood my problem pls tell me; how can i fix this
Jerry
View Replies !
View Related
If .swf Loaded Into Level, Then
HI
I am totally going out of my mind.
I need to know if this is possible. How do i write something that says, if a certain movie has been loaded onto a level in the timeline, then do not load this movie.
I have a button that when clicked, loads a .swf, BUT later in my movie timeline i have a loadMovieNum action, which i do not want to happen if this other movie has been loaded by clicking the button.
So confusing sorry in advance
Shawna
View Replies !
View Related
If Level Has Loaded Question?
Hi there,
I have 3 levels loading up from level 0, level 1,2 and 3.
Levels 1 and 3 are masked out whilst there are loadin up and will stop at there next scene when they are loaded.
Level 2 however will have a loading messsage on it and will be seen by the user, but what I'm having trouble with is
the code at the last frame of level2's loading up scene...?
I want level2 (at its last frame) to check if level 1 and 3 have loaded up, before they play next scene...?
here is the code i have already,in the last frame of level2:
if (_level1_totalframes>=62) {
_level1.gotoAndPlay("walk");
gotoAndPlay ("scene2", "fly");
if (_level3_totalframes>=62) {
_level3.gotoAndPlay("start");
gotoAndPlay ("scene2", "fly");
} else {
//this will loop the action
gotoAndPlay ("re");
}
}
need help big time,
cheers
matt
View Replies !
View Related
How Can I Check That A Level Has Loaded?
hi wonderful flash people:
I am in a bind about levels, now, I am loading a variable using levels, and I was wondering if there was a way that I could check to see if a level has loaded? I have this on the next frame (after loading the variable in the previous frame):
if (_level2.getBytesTotal() > 0) {
gotoAndPlay (38);
} else {
gotoAndPlay (35);
}
but it just stays on the current frame and I end up receiving a zillion emails (i am loading an ASP, and before you say it, the checking variables doesn't seem to work either...).
Hope you can help! Thanks and have a brill weekend!
Jag
View Replies !
View Related
How Can I Check To See If A Level Has Loaded?
hi wonderful flash people:
I am in a bind about levels, now, I am loading a variable using levels, and I was wondering if there was a way that I could check to see if a level has loaded? I have this on the next frame (after loading the variable in the previous frame):
if (_level2.getBytesTotal() > 0) {
gotoAndPlay (38);
} else {
gotoAndPlay (35);
}
but it just stays on the current frame and I end up receiving a zillion emails (i am loading an ASP, and before you say it, the checking variables doesn't seem to work either...).
Hope you can help! Thanks and have a brill weekend!
Jag
View Replies !
View Related
Controling .swf Loaded Into Level 1
See if this makes sense, It's driving me insane...
Ok, Im loading a movie into level 1, using loadMovie action within the base movie.
The movie thats being loaded has a "stop" action on the first frame.
When the base movie "level 0" reaches a certain frame, I want it to tell the movie loaded in Level 1(with "stop" action in frame one) to goto and play frame 2.
The reason im doing this is because the movie thats being loaded is rather large, so im attempting to get it to load unbenounced to the person viewing while they are watching the base movie. So that when its time for level 1 to be displayed, it will already be loaded and the person viewing doesn't know any different and doesn't have to wait.
Perhaps there is a better way to make this happen. HELP!!!!
Thanx
View Replies !
View Related
Checking To See If Level Is Loaded
Hi,
I hope this is the right group to post this in. I've check many posts and haven't found anything on my topic yet.
I've played around with getBytesLoaded() and getBytesTotal() put they don't get defined if I just test and debug the movie.
Here's what I'm doing.
My navigation is loaded into a high level, lets say Level 50. Its a .swf .
This works fine.
The nav contains three buttons. Each button will dynamically create a MC and load a specfic .swf into the MC. Each MC is created on a different level lower than Level 50
This works fine.
However, I want to check to see if a level is loaded so that
I.If the user clicks the same nav button a second time, the movie doesn't reload.
2. If the user clicks on a different button, the existing movie goes invisible and the new movie loads on top of the existing movie.
This code is in frame1 of my nav file.
topic.onPress = function() {
_root.createEmptyMovieClip("topiccontain",8);
_root.topiccontain._x = 50;
_root.topiccontain._y = 50;
loadMovie("lesson1.swf","_root.topiccontain");
}
I tried adding:
if ( getBytesLoaded() == 0 )
before doing the code in the fxn above, but when I trace getBytesLoaded() it says it is undefined.
How could I implement with variables?
Thanks for any help or other posts to information.
View Replies !
View Related
Checking To See If Level Is Loaded
How can i check to verify a movie on _level1 is loaded before proceeding? I thought there was an isLoaded property or something..
I have a preloader for my main movie, but i also want to be sure that a sub movie is loaded into level1 before the movie goes past the preloader..
-myk
View Replies !
View Related
Swf To Change It's Own Level After Loaded
hi, i have a swf thet gets loaded on to level 90 and plays. then when it stops i want it to jump to level 50. preferably with no flash of background color as it jumps which means it should jump to level 50 and then the level 90 files disappears a few frames after this has happened.
i am hoping that the script for this can be in the actual swf that will jump. so it tells itself to jump.
thanks for any help
mark
View Replies !
View Related
Refering To A Loaded Level?
Hey,
Ok I have loaded a movie into a level using this:
code:
loadMovieNum("_start_sound.swf", 1);
The loaded movie then has this code which needs plays a soundclip:
code:
sfx = new Sound();
sfx.attachSound("SFX");
// change "SFX" to identifier name of the sound you want to loop
sfx.start(0, 1);
i = 0;
_root.onEnterFrame = function() {
if (i>0) {
i--;
} else {
if (sfx.position>sfx.duration-100) {
//Restarts the clip around 100 milliseconds before the clip ends. Change this value as you see fit.
playing = true;
sfx.start(0, 1);
i = 30;
//gives a slight pause so that the sound clip doesn't restart twice. Change the value as you see fit.
}
}
};
stop();
However, nothing plays when I run main movie...I don't think I am referring to the levels properly or something, it's not working and I don't know why
Anyone know what I am doing wrong?
Cheers,
Chris
View Replies !
View Related
Undefined When Loaded In Level
Hi all,
I've got a strange problem. This code loads variables from a php-file:
Code:
// FUNCTION GET_LINE send/load vars ----------------------------------------------------------
function get_line(id){
// create loadvars object
the_lines = new LoadVars();
v_send = new LoadVars();
v_send.id = id;
cachekiller = new Date().getTime();
v_send.cachekiller = cachekiller;
// display vars
the_lines.onLoad = function(){
screen_mc.field_mc.lines_txt.htmlText = this.line;
//screen_mc.field_mc.lines_txt.htmlText = this.total;
// total is not yet set, first time
if (_root.total == 0){
_root.total = this.total;
_root.current = this.total
}
check_id();
};
// load wih cachekiller
v_send.sendAndLoad("lifeline/get_life_line.php", the_lines, "POST");//
};
// call function at startup -----------------------------------------------------------------------
get_line(0); // id = 0 for now
This works fine when the movie is by itself. But when I load this movie in level 10 inside another movie no variables are returned and I just get undefined. The path llifeline/get_life_line.php is correct as I placed the test movie in the same folder as the movie that loads the movie in level 10.
Hope someone can point me in the right direction as I've been working on this problem for hours.
Thanks very much in advance, Danielle.
View Replies !
View Related
Alpha Level = To % Loaded
Hi all,
I have a simple preloader that works fine.
I want the alpha level of a movie clip, (logo) to equal the percentage loaded so i added this: logo._alpha = mypercent.
The symbol never appears.
I added a dynamic text box to display the value of myPercent and it displays the correct value.
Can anybody point out my mistake?
myLoaded = Math.round(getBytesLoaded());
myTotal = Math.round(getBytesTotal());
myPercent = myLoaded/myTotal;
myBar._width = myPercent*150;
myText = Math.round(myPercent*100)+"%";
logo._alpha = myPercent;
if (myLoaded == myTotal) {
gotoAndPlay(5);
} else {
gotoAndPlay(1);
}
Regards,
Jase
View Replies !
View Related
How Can I Make A Loaded Swf Go To The Top Level?
I am doing a website in which I load a bunch of movies with an empty first frame to different levels in the first frame of the main movie. When I want to see each movie I have a button which tells a specific level to gotoandplay (2). Every time I "play" a loaded movie, I also tell all the others to gotoandstop (1) - so I wont see them anymore. my question is:
Is it possible to make a loaded swf to "jump" to a much higher level - and all the other movies go back to a lower level? this way I wont have to make my movies go back to frame 1 all the time.
I hope Im clear and that someone can help
View Replies !
View Related
If Movie Loaded In Level 8 Then.. Else...
Is there a way to check if a certain movie is loaded in a certain level.
I have a background that loads into level one and content that loads into level 2.
Each section has a different background and several sub sections. I want to put a script onto the buttons that checks whether the correct background swf is loaded for each section when you are there and only load the content for that sub-sector but if the background is wrong then to load that also.
I presume it'll be something like this but I am brand new to actionscript.
On (release)
If level1 contains "correctbackground"
then
load movie ("content",2)
else
loadmovie("correctbackground",1)
loadmovie("content",2)
end if
The reason for this is because when entering a new section it will have a new background, but when moving through the subsectors I don't want it to keep reloading the background.
Thanks in advance for any help
View Replies !
View Related
Detecting If A Level Is Loaded..please Help
Hi,
I desperately need some help with my actionscript coding.
My main movie loads the menu bar and then the main pages are loaded into level 1, except for a music player which is loaded into level 3.
When a certain page is loaded - the music player level (3) is intentionally 'unloaded' from the main movie.
The problem is - when the user goes to another page I need some actionscript coding to detect if the music player is loaded in level 3 - if it is then do nothing, and if it isn't then to load it in.
Hope this makes sense....
Thanks to anyone who answers this one.
View Replies !
View Related
How Can I Make A Loaded Swf Go To The Top Level?
I am doing a website in which I load a bunch of movies with an empty first frame to different levels in the first frame of the main movie. When I want to see each movie I have a button which tells a specific level to gotoandplay (2). Every time I "play" a loaded movie, I also tell all the others to gotoandstop (1) - so I wont see them anymore. my question is:
Is it possible to make a loaded swf to "jump" to a much higher level - and all the other movies go back to a lower level? this way I wont have to make my movies go back to frame 1 all the time.
I hope Im clear and that someone can help
View Replies !
View Related
How Can I Make A Loaded Swf Go To The Top Level?
I am doing a website in which I load a bunch of movies with an empty first frame to different levels in the first frame of the main movie. When I want to see each movie I have a button which tells a specific level to gotoandplay (2). Every time I "play" a loaded movie, I also tell all the others to gotoandstop (1) - so I wont see them anymore. my question is:
Is it possible to make a loaded swf to "jump" to a much higher level - and all the other movies go back to a lower level? this way I wont have to make my movies go back to frame 1 all the time.
I hope Im clear and that someone can help
View Replies !
View Related
HoW To Load A MC Over Another MC Was Loaded In Level 2
Under index.swf the file index2.swf loads in level 2 :
- (loadMovieNum ("flash_folder/index2.swf", 2); -
index.swf is just an introduction , actually index2.swf is the action
on which there are 3 buttons that I intend to load 3 other
movies , let´s call them x , y and z , over index2.swf ;
I am not exactly sure about the level such mcs will be loaded ,
are the below codes right ? if index2.swf is loaded on level 2
x will load in level 3 ...and so on ?
(loadMovieNum ("flash_folder/x.swf", 3);
(loadMovieNum ("flash_folder/y.swf", 4);
(loadMovieNum ("flash_folder/zswf", 5);
Thanks for any help provided
View Replies !
View Related
Refering To A Loaded Level?
Hey,
Ok I have loaded a movie into a level using this:
Code:
loadMovieNum("_start_sound.swf", 1);
The loaded movie then has this code which needs plays a soundclip:
Code:
sfx = new Sound();
sfx.attachSound("SFX");
// change "SFX" to identifier name of the sound you want to loop
sfx.start(0, 1);
i = 0;
_root.onEnterFrame = function() {
if (i>0) {
i--;
} else {
if (sfx.position>sfx.duration-100) {
//Restarts the clip around 100 milliseconds before the clip ends. Change this value as you see fit.
playing = true;
sfx.start(0, 1);
i = 30;
//gives a slight pause so that the sound clip doesn't restart twice. Change the value as you see fit.
}
}
};
stop();
However, nothing plays when I run main movie...I don't think I am referring to the levels properly or something, it's not working and I don't know why
Anyone know what I am doing wrong?
Cheers,
Chris
View Replies !
View Related
Check Swf Loaded In Level
I have a mult-language site I'm still building. What I am trying to do is when you click on the lang switch it checks what swf you are on and loads that onel in spanish. Only problem is all my attempts at creating a statement that will find out the swf has not worked.
Code:
import mx.transitions.Tween;
import mx.transitions.easing;
//var for string for checking if it's english or spanish
var lang:String = "english";
// END
//var for string to see what page it's on.
var lodedSwf:String;
//tells what String to load into the layout level
var spanishTitle:String;
spanishTitle = "";
trace(lodedSwf);
trace(spanishTitle);
// lang switch
[b]this.espanol_mc.onRelease = function():Void
{
if(_level5 == "home.swf")
{
lodedSwf = "home";
trace("from smenu: " + lodedSwf + "is the level5");
}
if(_level5== "bio.swf")
{
lodedSwf = "home";
trace("from smenu: " + lodedSwf + "is the level5");
}[/b]
/*if (this._currentframe == 1)
{
*/
bringUpDn(popMenu, 100, 0, "down");
bringUpDn(espanol_mc, 100, 0, "down");
/*lang = "spanish";
this.gotoAndStop(10);
}
else
{
bringUpDn(popMenu, 0, 100, "down");
this.gotoAndStop(1);
lang = "english";
}
trace(lang);*/
};
// lang switch function END
//trace(lang);
//--------------HOME
_root.popMenu.home_btn.onRollOver = function():Void
{
trace("home");
_root.popMenu.gotoAndStop("home");
};
_root.popMenu.home_btn.onRelease = function():Void
{
//page loaded is
lodedSwf = "home";
trace(lodedSwf + " page Loaded");
//END
//trace statements
trace("home pressed");
trace(lang);
//END
// goes to layout bg
_level2.margaret.gotoAndStop(36);
//END
//format Margaret's name to 40pt and black
var fmt:TextFormat = new TextFormat();
fmt.color = 0x000000;
fmt.size = 40;
_level2.margaret.margaret_txt_mc.margaret_txt.setTextFormat(fmt);
//END
//navBtnEnable();
//_level0.mcL.unloadClip(_level6);
//goes to home bg
_level2.gotoAndStop(37);
//load home swf
_level0.mcL.loadClip("home.swf", 5);
//text banner null
_level2.pageName_mc.pageName.text = "";
};
//--------------HOME END
//--------------BIO
_root.popMenu.bio_btn.onRollOver = function():Void
{
trace("bio");
_root.popMenu.gotoAndStop("bio");
};
_root.popMenu.bio_btn.onRelease = function():Void
{
//page loaded is
lodedSwf = "bio";
spanishTitle = "biograph?a";
trace(lodedSwf + " page Loaded");
//END
_level2.gotoAndStop("bio");
_level2.margaret.margaret_txt_mc.margaret_txt.setTextFormat(name_fmt);
_level0.mcL.loadClip("bio.swf", 5);
_level2.pageName_mc.pageName.text = "Biography";
};
//--------------BIO END
//--------------BOOKS
_root.popMenu.books_btn.onRollOver = function():Void
{
trace("books");
_root.popMenu.gotoAndStop("books");
};
_root.popMenu.books_btn.onRelease = function():Void
{
lodedSwf = "books";
spanishTitle = "libros";
_level2.gotoAndStop("books");
_level2.margaret.margaret_txt_mc.margaret_txt.setTextFormat(name_fmt);
_level0.mcL.loadClip("books.swf", 5);
_level2.pageName_mc.pageName.text = "Books";
};
//--------------BOOKS END
//--------------COMMUNITY
_root.popMenu.comm_btn.onRollOver = function():Void
{
trace("community");
_root.popMenu.gotoAndStop("comm");
};
_root.popMenu.comm_btn.onRelease = function():Void
{
lodedSwf = "comm";
spanishTitle = "communidad";
//_level0.mcL.unloadClip(_level6);
//navBtnEnable();
//_root.popMenu.comm_btn.enabled = false;
_level2.margaret.margaret_txt_mc.margaret_txt.setTextFormat(name_fmt);
_level0.mcL.loadClip("comm.swf", 5);
_level2.gotoAndStop("comm");
_level2.pageName_mc.pageName.text = "Community";
};
//---------------COMMUNITY END
//---------------LAW END
_root.popMenu.law_btn.onRollOver = function():Void
{
trace("law practice");
_root.popMenu.gotoAndStop("law");
};
_root.popMenu.law_btn.onRelease = function():Void
{
lodedSwf = "law";
spanishTitle = "pr?ctica de la ley";
//_level0.mcL.unloadClip(_level6);
//navBtnEnable();
//_root.popMenu.law_btn.enabled = false;
_level2.margaret.margaret_txt_mc.margaret_txt.setTextFormat(name_fmt);
_level0.mcL.loadClip("law.swf", 5);
_level2.gotoAndStop("law");
_level2.pageName_mc.pageName.text = "Law Practice";
};
//---------------LAW END
//---------------CONTACTS END
_root.popMenu.contacts_btn.onRollOver = function():Void
{
trace("contacts");
_root.popMenu.gotoAndStop("contacts");
};
_root.popMenu.contacts_btn.onRelease = function():Void
{
lodedSwf = "contact";
spanishTitle = "contactos";
//_level0.mcL.unloadClip(_level6);
//navBtnEnable();
//_root.popMenu.contacts_btn.enabled = false;
_level2.margaret.margaret_txt_mc.margaret_txt.setTextFormat(name_fmt);
_level0.mcL.loadClip("contact.swf", 5);
_level2.gotoAndStop("contacts");
_level2.pageName_mc.pageName.text = "Contacts";
};
// enable all menue items currently not used
function navBtnEnable():Void
{
_root.popMenu.home_btn.enabled = true;
_root.popMenu.bio_btn.enabled = true;
_root.popMenu.books_btn.enabled = true;
_root.popMenu.comm_btn.enabled = true;
_root.popMenu.law_btn.enabled = true;
_root.popMenu.contacts_btn.enabled = true;
}
function bringUpDn(tweenClip:MovieClip, from:Number, to:Number, tweening:String):Void
{
//trace(tweenClip + " visiblity is " +tweenClip._visible);
if (tweening == "down")
{
if (tweenClip <= 30)
{
//tweenClip._visible = false;
}
}
if (tweening == "up")
{
if (tweenClip <= 0)
{
//tweenClip._visible = true;
}
}
var alfTween = new Tween(tweenClip, "_alpha", Regular.none, from, to, 1, true);
alfTween.onMotionFinished = function():Void
{
_level0.mcL.loadClip("smenu.swf", 10);
goToPage(lodedSwf);
trace(lodedSwf + " String Loaded");
};
}
// loades ex: shome.swf and home as layout text
function goToPage(lodedSwf):Void
{
_level0.mcL.loadClip("s" + lodedSwf + ".swf", 5);
_level2.pageName_mc.pageName.text = spanishTitle;
}
Any help is appreciated
View Replies !
View Related
SetProperty Of A Loaded Movie In A Level?
Is it at all possible to control the placement of a loaded movie that has been placed in a new level?
_level1.setProperty._x = 100 doesn't work...
I know you can position .swf's using the targetting method when loading a movie, but what about in a new level? I would try to use the targetting method, but then the scripting in the "to be loaded" swf doesn't work...
any help is appreciated... i am open to any solutions... actionscript, javascript, whatever... but it can't be slicing the page into html and postioning my swfs in table cells.
thanks.
~N
View Replies !
View Related
Root Level Preloader For Loaded MCs?
hi there. . .
i have a portfollio site with multiple external ".SWF" files loading (one at a time, depending on the button clicked on) with the "loadMovie" command.
• They each replace a main MC called "display".
• There are a few dozen of them, and they each take about ten seconds to load.
I want to use a preloader, or something to tell the user that an image is loading, but I don't want to build it into the .swf files, this would take too long, and be a real pain to update, or make changes to.
How do I cause an action to occur, (or a MC to play on the main movie,) only while the replacement for "display" is loading, via the loadMovie command??
thanks much for your help
Darin
View Replies !
View Related
How Can I Position An Externally Loaded .swf, Level 3?
I am loading an external .swf (level 3) while keeping the current .swf in the backgound. It works fine, but I need to move it up about 50 pixels. How do I set the exact position in the action script? All the suggestions I have seen on the forum don't seem to work for me and I can't find it in the manuals. I am not using onClipEvent, I am using loadMovieNum, script below. My stage is 800 x 400 pixels. I've been told that the .swf file need to fully load before giving the x y coordinates. I haven't been able to do this. I don't want it to visibly load, then jump on the page. I've tried these 3 scripts.
1. This first one is on the site now, and works, but I need to reposition it.
-----------------------------
loadMovieNum ("http://www.pageworksdesign.net/flash/portfolioMenu.swf", 3);
stop ();
2. I tried the next two, after suggestions from Macromedia forum.
------------------------------
loadMovieNum ("http://www.pageworksdesign.net/flash/portfolioMenu.swf", 3);
stop ();
_level3._x = 50;
_level3._y = 50;
3.
---------------------------------
loadMovieNum ("http://www.pageworksdesign.net/flash/portfolioMenu.swf", 3);
_level3._x = 50;
_level3._y = 50;
stop ();
-------------------------------------
Thanks,
Laurie
View Replies !
View Related
How Can I Controll A Movie That Is Loaded On Level 1
hello friends...
i have a prob here.....
i have a MAIN mc.... now em loading SECOND mc on level 1 in MAIN mc...
now i want to controll the SECOND mc from main....
i mean how can i stop or play the SECOND mc whenever i want to... by pressing a button in MAIN mc....
i tried my best.... but i cant controol it.. ???... em sure if there is anyway of doing this then i will get my answer ....
View Replies !
View Related
Level Loaded Movie Sketchy - Help
so im loading a series of movies into a holder. each one has its own nav and im loading them into level 1 but im leaving a background image on level 0 so that there is something that remains throughout the transitions. inside one of the movies i have a sliding menu that just stops working every now and then. the call is going:
on (rollOver) {
if (_global.menustate == "closed") {
_level1.buttonslide.play();
_global.menustate = "open";
}
with (_root.vidprevA) {
gotoAndPlay(2);
}
}
on (rollOut) {
with (_root.vidprevA) {
gotoAndPlay(1);
}
}
this is driving me nuts, any tips appreciated. i will post the files if necessary but its a whole series....
m
View Replies !
View Related
Sound Won't Play When Loaded On Level ?
This is weird...
I publish my swf which contains a song. When I play the swf, everything works fine.
However, when I load the swf into level one of another movie- the audio won't play. I can see that the swf has loaded onto level one, but the audio refuses to play...
ANY suggestions?
cheers
jen
View Replies !
View Related
Disable Buttons When A New Level Is Loaded
is there a command that would allow me to disable the buttons on a layer when a new layer is loaded above the other.
i have a level 1.swf loaded.
when i click a button it loads my level 2.swf
and i dont want the buttons on the level 1.swf to be active
in this case i cant move on the timeline.....
any suggestions..............
View Replies !
View Related
Controlling An Swf File Loaded On A Different Level
I have a cd rom that i'm building in flash. It includes audio that is a separate swf file and part of the navigation so it is on the base level 0. the rest of the content is loaded on additional levels as the user clicks around the cd. There are a couple of screens, for example, Video page and adobe reader installation page with buttons to open the video or install the software that i want to stop the audio when the user clicks the button. the simple way to do this is to use the "stop all sounds" command. however, this stops the sound but the Play/stop button still shows its playing. I need to be able to make it so that when the user clicks the button that it goes to the level with the audio on it and then to a specified frame, so that the play/stop button changes state.
hope this make sense, its kindof hard to explain.
thanks
View Replies !
View Related
Targeting A Scene From An Swf Loaded Into A Level
How do I target a main movies time line address from within another movie that will be loaded into a level in side that main movies time line. I know how to target the loaded movie on a _level within the main movie, but I am not sure how to target it going back out to communicate with the movie it is loaded into so that it will direct to the path of play were I want it to. I know I don't want to use _root., so what do I use?
View Replies !
View Related
|