Passing variables to loaded external movie
Ok, this problem has beaten me for the last 2 days. It seems
to be extremely simple, I am on main movie and I am using
MovieClipLoader class to load external movie callMe.swf into movie
holder called holder_MC, then from main using onLoadInit or
onLoadProgress listeners I can target dynamic text inside
callMe.swf as holder_MC.myTXT.text = "blablabla" or I can change
frames in callMe.swf by holder_MC.gotoAndStop(5). But HOW TO PASS
VARIABLE myVar to callMe.swf so it executes something there? Using
holder_MC.myVar DOESN'T WORK!!!!!!!!!!!!!!
Thanks for any help,
Zbynek
UPDATE... I copied the link to another page with my variables in the image attributes as I posted above. And it works using the values that are cached for those items. Is there any way to do this on the same page as my original link without my users having to change to a different page?
Similar Messages
-
Movie inside of a loaded external movie
Hi
how to control a mc inside a loaded external movie?
so I have a main.swf, loaded a ex.swf into it by using loadMovie, and inside ex.swf there is a mc called 'mc'
how do I control 'mc' from main.swf? I tried something like newLoader.mc._x +=1; ( newLoader is ex.swf), it doesn't work?
Thanks for reply.Hi Ned
after I read your reply, i went on make a new sample file just to try it out, and it work, then I went back to my file and found out on these code
var currentObject = new Object;
currentObject = newLoader.newLoader2.newLoader3;
var currentObjectColor = new Object;
currentObjectColor = currentObject;
and then I have
var my_color:Color = new Color(currentObjectColor.mc);
trace (allowColor);
my_color.setRGB(this.colorCC);
for some reason, after I replace currentObjectColor to just currentObject, it work just fine, I don't know if the problem is from putting one object equal another one, but as far as I need this would work for me.
thanks a lot. -
I've created (with help) a series of buttons that scroll a
movieClip's x-position according to an arrayIndex. With variables,
these buttons also cycle through their up and down state as the
user clicks from one to the next. I'd like for them to also load an
external flash movie into a "loader" movie clip. More precisely, a
different external swf for each button.
I don't know how to include the loadMovie script into the
(beyond my skills) action script that controls my x-postion
buttons. I've tried to write the bellow code for each button, but
it stops my x-position scroll.
I tried to use this code... but it stops my movieClip from
scrolling.
controller_mc.but1.onRelease = function() {
loadMovie("chapterTest.swf", "_root.loader");
Here is my complete code. I'd be happy to answer any question
and I'll also attach my file for review. Thank you.
click here for
my filesHi,
Ok, you mentioned that you had an issue when clicking on a
button to load an external movie it would stop your x-position
scroller. I downloaded your files and you have a button in the
library that's found in the timeline called btnLink_01. You have an
button event called:
//thumb links
timeline1.link01.onRelease = function() {
When I opened your file and ran the movie, I click on the
btnLink_01 at it did not load the external movie called test.swf,
which I created, and didn't seem to affect your x-scroll
functionality. I did some troubleshooting and set the color
properties from Alpha to None on movieclip "loader" movie and it
loaded the external movie just fine. Seemed like you had the alpha
set to 0, so when the movieclip was loaded, it didn't show up. Not
sure if this is the issue you had. Let me know if that helps or if
I wasn't resolving your issue correctly.
Thanks,
Jaime -
Loading external movies differently
I am making a web site with several pages that the content
will load as an external movie. Right now I have all loading with
the nav buttons "on release". The first page loads through one
blank clip and the rest in another. What I would like to do is have
the first external page/clip content load with the main page and
also reload with the nav button if someone wishes to return and
leave the other buttons to remain loading each pages external
content like they are now. So is there a way to get the first pages
content to load both ways? This is what the code for the first
button looks like now :
on (release) {
//load Movie Behavior
if(this.aboutext == Number(this.aboutext)){
loadMovieNum("aboutus.swf",this.aboutext);
} else {
this.aboutext.loadMovie("aboutus.swf");
//End Behavior
//unload Movie Behavior
if(this.blk == Number(this.blk)){
unloadMovieNum(this.blk);
} else {
this.blk.unloadMovie();
//End Behavior
Right now everything works I just don't have any content
until a button is clicked.Hi,
Take a look at this simple tutorial and you will find what
you are looking for.
Here
Hope this helps
Cheers
Alan -
'Load external movie clip' behavior
I am currently working on a flash movie that loads with an
animation and stops to show four buttons that are then supposed to
load external .swf files when clicked (released). While the
behaviors and actions I have set all work fine when I test the
movie in Flash, when all the files are uploaded to my server, the
external movie clip does not load, and the message in the bottom
left corner of the browser hangs at waiting for
www.panoramalotforsale.com...
Anybody any idea what I'm doing wrong?When everything works fine locally, but fails to load live on
your webserver, there is of course a pathing problem.
So, in your flash, when you call loadMovie, try using a full
path to the external file your trying to load.
So for example, instead of "/movies'/myexample.swf", do "
http://www.yoursite.com/movies/myexample.swf".
Make sure you keep the
http:// though. -
Loading external movies in specific frames
Here's what I'd like to have my project do: By clicking on a
button in frame 5 I'd like to load a movie into an empty movie clip
in frame 20. I'v ewritten the script to create the empty movie clip
and also load the movie, but the movie loads into all frames of my
project. I'd ideally like to have the movie clip waiting for my
only in frame 20. Anyone know how to make this happen?
Thanks
Ericyou could not load it into an empty movie clip located on
frame 20 from frame 5, flash wouldn't know where to load it since
the movie clip hasn't shown up... you could load it in on frame 5
and give the movie clip a _visible = false; or set it's _x and _y
properties to be off the stage, then on frame 20 set it to _visible
= true; or move its _x and _y properties to be on the
stage.. -
I created a captivate movie and published it into a swf. I
need to play this in Flash. I created a MC blank placeholder and
added a behavior. However, it errors with a very long message,
stating it can't find any of the children. Helpok great - i never use behaviors, so looked this one up. but
something else is confusing here - you say '...find any of the
children' is the error you're getting - this would indicate that
your using AS3 (i thought i saw that in another of your posts as
well) and behaviors only work under AS2 - so that's a bit odd
really LOL! :) however, the behavior uses loadMovieNum and
LoadMovie methods - so it looks like it's just not 'finding' the
placeholder MC that you've constructed and targeted - check and
make sure you've given an 'instance name' to the placeholder MC -
and that you placed it on the stage. -
I have a huge movie clip to be imported, its pretty huge so I
divided them to smaller pieces and tried to import, everything my
PC gets hung and does not respond after import. What is the best
method to import a single huge movie clip? Your help is
appreciated.Problem Solved.
To everyone that has experienced some version of this issue,
whether it be in previewing a load progress bar, or having
animation freeze on you while loading external movie files...
In test mode in flash, whether you are doing a simple test
movie or debugging, loading progress appears to not be threaded and
will freeze you movie until the load is complete. if you preview
this movie clip in a browser after publishing it, everything should
look ok.
I've read a lot of posts about this same topic. Macromedia
(or shall i say Adobe), fix this issue in your next release. what a
pain...seriously. debugging is useless if the movie doesn't even
run the same.
very much relieved,
Al. -
Loading a Movie that Loads other Movies
Hi All,
I am working on a kiosk. There are two seperate versions of
the kiosk, one in english and one in spanish. Both of these
versions are in a seperate folder. I want to create an exe that
will give the user the choice of language and then load that
version. Unfortunately, the seperate versions of the kiosks also
load external movies. So for example, when I load the english
version it is looking for the external swf in the same directory of
the movie that is loading it.
Is there any way around this? I want to basically "lock" the
loaded movie so that any calls to external swf's refer to the
directory structure of the loaded movie and not the movie that is
calling it. I can't put the external files in the same directory as
the main movie because both versions use files with the same names.
Thanks for any available help!
-=ChrisOkay, here is a simplified example of my directory structure:
|-Main.exe
|--------------- spanish folder
|---------------------------------spanish.swf
|---------------------------------Content Folder
|------------------------------------------------content1.swf
|------------------------------------------------content2.swf
|------------------------------------------------content3.swf
|--------------- english folder
|---------------------------------english.swf
|---------------------------------Content Folder
|------------------------------------------------content1.swf
|------------------------------------------------content2.swf
|------------------------------------------------content3.swf
Main.exe gives the user the choice to select English or
Spanish. If the user selects English, then english.swf is loaded
into main.exe. However, when english.swf is loaded, it no longer is
able to load content1.swf from the content folder. I understand
that I can change the path in english.swf to make it work, but
there are a great deal of paths that would need to change. Is there
any way to lock the loaded movie(english.swf) so that any calls to
external swf's(content1.swf) refer to the directory structure of
the loaded movie(english.swf) and not the movie that is calling it
(main.exe). Thanks again!
-=Chris -
Passing variable to a loaded movie
Let's say, a movie
loads an external MovieClip,
using a MovieClipLoader, and locks
the root, with code as the
following:
//I'd like to pass this variable
var myVar = "Passed it to Shell";
this.createEmptyMovieClip("Shell",
this.getNextHighestDepth());
var lo:Object = new Object();
lo.onLoadInit = function(target_mc){
target_mc._lockroot = true;
var mcl:MovieClipLoader = new MovieClipLoader();
mcl.addListener(lo);
mcl.loadClip("ExternalMovie.swf", Shell);
//end.
Now, once Shell is loaded, how
do I access myVar?
I tried _parent.myVar, which
doesn't work. (Since Shell has
the _root locked.)
I changed the onLoadInit to
lo.onLoadInit = function(target_mc){
target_mc.myVar = myVar;
target_mc._lockroot = true;
and then tried to access inside
Shell by this.myVar, which still
doesn't work.
I'd appreciate any suggestions.myVar is defined in the
loading movie. (On the
first line lf the listed
code). Actually, it
is passed to the movie,
which in turn loads
external contents to a
MovieClip named Shell.
So how could myVar be
accessed inside Shell? -
Loading External SWF and setting variables
Hello Everyone.
I'm sure you are all a where of the FlashVars attribute for
Flash embeds which holds variables for SWF's when they are
rendered. I'm attempting to load an External SWF dynamically
from within my own SWF and need to provide it with the values
normally stored in the FlashVars. For the example below I
wait until the External SWF is completely loaded using the
onLoadInit event from moviecliploader and then i attempt to
set the required variables that the loaded SWF needs. This works
great in test and debug mode (ie. Test Movie and Debug Movie
from the Control menu), but when i publish my FLA to SWF and run
the SWF the variables will NOT get set in the loaded External SWF.
From my readings ive people have mentioned that the player is only
able to access Methods of an External SWF. If this is the case then
how do they expect people to set the FlashVars of dynamically
loaded SWFs? I investigated the loadVariables procedure as well and
had the same results in test mode and was wasn't reliable because
of timing issues.
The sample source is below... if anyone has any ideas or has
come across this issue before, I would really appreciate some
insight.
Thank you in advance for your time.
var loader_mc:MovieClipLoader = new MovieClipLoader();
var mclListener:Object = new Object();
loader_mc.addListener(mclListener);
mclListener.onLoadProgress = function(target_mc:MovieClip,
numBytesLoaded:Number, numBytesTotal:Number) {
// DO NOTHING
mclListener.onLoadComplete = function(target_mc:MovieClip) {
// DO NOTHING
mclListener.onLoadInit = function(target_mc:MovieClip) {
// WORKS IN TEST MODE NOT IN PUBLISH/SWF MODE
target_mc._root.param1 = "value1";
// WORKS IN TEST MODE NOT IN PUBLISH/SWF MODE
_level0.container_mc.param1 = "value1";
this.createEmptyMovieClip("container_mc",
this.getNextHighestDepth());
container_mc._lockroot = true;
loader_mc.loadClip("somecoolflash.swf", container_mc);I've tried that as well and it behaves the same as onLoadInit
... Works when i test but doesnt when i publish to a swf. I think
this is security related and the flash player just cant write to a
loaded swf and set variables. -
How to load external subtitles in mov files (in QT)?
Hi everybody,
When I play an avi file, QT is able to load external subtitles (I've Perian installed). However, this week, I downloaded a file from apple, saved it as a mov file and created a subtitle file for it. Then, I put both files in the same directory and used the same name for them (one .mov and the other .srt). When I play it (with QT), the subtitle file doesn't load. Does anybody know what is happening? Is is a problem with mov files? Or is it a problem with files downloaded from apple (some kind of lock?!)?
Thankscowpox wrote:
Hi everybody,
When I play an avi file, QT is able to load external subtitles (I've Perian installed). However, this week, I downloaded a file from apple, saved it as a mov file and created a subtitle file for it. Then, I put both files in the same directory and used the same name for them (one .mov and the other .srt). When I play it (with QT), the subtitle file doesn't load. Does anybody know what is happening? Is is a problem with mov files? Or is it a problem with files downloaded from apple (some kind of lock?!)?
Thanks
You might do better reposting this in the QuickTime forum here:
http://discussions.apple.com/forum.jspa?forumID=932 -
Can I use a plug in USB camera reader to have a load of movies etc on an external hard drive and then plug and play so to speak? I'm off on holiday and haven't got the capacity on the iPad to have everything on that I'd like for the kids.
So basically I want a hard drive with X amount of films etc on. Can I then watch them on my iPad?
Hope this makes sense.External HDD won't work.
You need something like this:
http://www.seagate.com/goflexsatellite/ -
Loading An External Movie...
I'm new to Flash and this may seem like a silly question but I need help with using an external .swf file in my main timeline for my site. Basically, I've figured out how to load the movie and that works great, but the problem is when I click off of that page the movie stays up there. What is the best way for me to exit out of that movie once the user clicks on anything outside of that movie? Your help is greatly appreciated!
BFMOne way would likely be to have an empty movieclip in the timeline that you load that swf into. When you load something dynamically, if it isn't targeted to load into something that lives on the timeline, it doesn't have a home relative to the timeline, so moving along the timeline doesn't make it go away.
Another way is to remove the swf, and doing that depends on how you loaded it (which version of AS). -
Need buttons on base movie to become inactive when external movie loaded
Hi,
I am working on a portfolio website and I have all my navigation with buttons linking to other pages, on the base level. All the buttons are scattered around the stage and when one of these buttons is clicked an external movie is loaded in the centre of the page.
The movie is a big white box with a slideshow of images from my portfolio in the centre of the stage.
My problem is that the buttons on the base level are easily clicked by accident, even though you cant see them with the white box.
Is there anyway I can stop the base movie clip working, once a button is clicked? When the user has finished looking at my slideshow images then they press a close button.
Code used for button on main timeline:
swfBtn.onRelease = function()
loadMovieNum("graphicLayouts.swf", 1);
Code used for Close button on external swf:
on (release) {
unloadMovieNum(1);In your case I'd recommend writing the said above two function on main timeline. It should go something like this:
function enableBtns():Void
BTN_1.enabled = true;
BTN_2.enabled = true;
// ... and so on
function disableBtns():Void
BTN_1.enabled = false;
BTN_2.enabled = false;
// ... and so on
Now, in the function where you call the loadMovie method (it's on the main timeline, right) just write:
disableBtns();
And in the external swf file, where you unload your swf write:
_level0.enableBtns();
It should work if I didn't bug anything.
Maybe you are looking for
-
I have been a Mac user for 6 years now. In my home we have 3 G4's (eMac, PowerBook & Power Mac) and a G5 on the way. I just bought my Mom, a diehard Windows user until now, a Mac Mini running Tiger 10.4.5. She has had problems with Mail crashing sinc
-
Buttons opening a web page within a web page.
I want to click on a button that will open a web page inside the same web page. How how I do this? Thanks, L
-
How can I make photos on web page enlarge with mouse-over?
How can I make photos on web page enlarge with mouse-over?
-
HT2736 Can you make in-app purchases with a gift app?
I have a friend that let me sync up and get fruit ninja and I'm going to make an in-app purchase but I want to know if you can make an app purchase with a gift app
-
the graphics for the icons on my desktop keep disappearing, all that remains is a dotted line around where it once was. the file name remains intact. Does any one know why? Have a screen shot but cannot see how to add it to message? Message was edite