Page 1 of 1
Implement getURL on seperate Flash loadMovie items
#1
Posted 30 July 2008 - 08:16 AM
First post so go gentle!
I am creating a menu that is formed using four seperate movies.
I have managed to use loadMovie and some 'holder' movieclips to import the item movies and then animate them on the stage. Everything works fine apart from the getURL bits!! (Quite important in a menu I think you'll agree!)
I originally had the getURL statement on an onMouseDown function in the item movies themeselves, however in the final movie it didn't matter what you clicked on, you always got the link from the highest layer.
So I tried removing the getURL from the item movies and putting it on the instances in the main movie, and that didn't work either!!!
How do I get this working!!??
Regards,
Gordon
(If it helps I am using Flash CS3 and Actionscript 2.0)
I am creating a menu that is formed using four seperate movies.
I have managed to use loadMovie and some 'holder' movieclips to import the item movies and then animate them on the stage. Everything works fine apart from the getURL bits!! (Quite important in a menu I think you'll agree!)
I originally had the getURL statement on an onMouseDown function in the item movies themeselves, however in the final movie it didn't matter what you clicked on, you always got the link from the highest layer.
So I tried removing the getURL from the item movies and putting it on the instances in the main movie, and that didn't work either!!!
How do I get this working!!??
Regards,
Gordon
(If it helps I am using Flash CS3 and Actionscript 2.0)
#2
Posted 30 July 2008 - 12:01 PM
Hello
The attachment shows a way of loading a swf into another flash movie using a MovieClipLoader + making the loaded movie link to a url. The example loads three flash movies and makes them link to different urls. Its done in CS3/actionscript 2.
I've used the same MovieClipLoader to load the three swf's, making use of a switch statement in the MovieClipLoader's onLoadInit function to add the appropriate onRelease function to each movie.
Let me know if you need the code explaining.
Rob
The attachment shows a way of loading a swf into another flash movie using a MovieClipLoader + making the loaded movie link to a url. The example loads three flash movies and makes them link to different urls. Its done in CS3/actionscript 2.
I've used the same MovieClipLoader to load the three swf's, making use of a switch statement in the MovieClipLoader's onLoadInit function to add the appropriate onRelease function to each movie.
Let me know if you need the code explaining.
Rob
Attached File(s)
-
MovieURL.zip (29.85K)
Number of downloads: 10
#4
Posted 30 July 2008 - 01:58 PM
Rob,
I have had a go (kind of get the code, although the functions in actionscript are still very new to me).
I ditched the EmptyMovieClip statements as I already have container movieclips on the stage, and the are set to move and fade etc.
I included everything after that changing the movieclip names etc as required.
It runs but it appears that all four items are sitting on top of each other, so I can only see the last to load???
Each of my clips/containers has their own layer so that I can layout the movements etc, should my AS be associated with the individual layers, or on an actionscript layer (current setup)?
Regards,
Gordon
(If it will help I can package up what I have achieved and post it on here?)
I have had a go (kind of get the code, although the functions in actionscript are still very new to me).
I ditched the EmptyMovieClip statements as I already have container movieclips on the stage, and the are set to move and fade etc.
I included everything after that changing the movieclip names etc as required.
It runs but it appears that all four items are sitting on top of each other, so I can only see the last to load???
Each of my clips/containers has their own layer so that I can layout the movements etc, should my AS be associated with the individual layers, or on an actionscript layer (current setup)?
Regards,
Gordon
(If it will help I can package up what I have achieved and post it on here?)
#5
Posted 30 July 2008 - 02:40 PM
Hello
When you load in a movie, it aligns it self to the containing movies registration point - when you create a movieclip on the flash stage using Convert to Symbol, you can choose the placement of the registration point by clicking on one of the nine squares. If you add several movies to one movieclip, they all have their top left corner aligned to the containing movies registration point.
A way to add several movies to a single movieclip + be able to position them is:
instead of
this.createEmptyMovieClip("containerOne", getNextHighestDepth());
containerOne._x = 50;
containerOne._y = 50;
use - where container_mc is the instance name of the movieclip on the stage:
container_mc.createEmptyMovieClip("containerOne", container_mc.getNextHighestDepth());
container_mc.containerOne._x = 50;
container_mc.containerOne._y = 50;
The _x + _y values of container_mc.containerOne are relative to container_mc's _x + _y position, not from 0,0 on the stage.
Anywhere in the code where containerOne/Two/Three is used , you will need to add container_mc. before them. In the switch statement, you will need to change :
case containerOne :
to
case container_mc.containerOne
and in the load bit change :
mcLoader.loadClip("one.swf", containerOne);
to
mcLoader.loadClip("one.swf", container_mc.containerOne);
If this does not help, zip your files and post them.
Rob
When you load in a movie, it aligns it self to the containing movies registration point - when you create a movieclip on the flash stage using Convert to Symbol, you can choose the placement of the registration point by clicking on one of the nine squares. If you add several movies to one movieclip, they all have their top left corner aligned to the containing movies registration point.
A way to add several movies to a single movieclip + be able to position them is:
instead of
this.createEmptyMovieClip("containerOne", getNextHighestDepth());
containerOne._x = 50;
containerOne._y = 50;
use - where container_mc is the instance name of the movieclip on the stage:
container_mc.createEmptyMovieClip("containerOne", container_mc.getNextHighestDepth());
container_mc.containerOne._x = 50;
container_mc.containerOne._y = 50;
The _x + _y values of container_mc.containerOne are relative to container_mc's _x + _y position, not from 0,0 on the stage.
Anywhere in the code where containerOne/Two/Three is used , you will need to add container_mc. before them. In the switch statement, you will need to change :
case containerOne :
to
case container_mc.containerOne
and in the load bit change :
mcLoader.loadClip("one.swf", containerOne);
to
mcLoader.loadClip("one.swf", container_mc.containerOne);
If this does not help, zip your files and post them.
Rob
#6
Posted 05 August 2008 - 09:10 AM
Roberto, on Jul 30 2008, 15:40, said:
If this does not help, zip your files and post them.
Rob
Rob
Rob, sorry but I'm back!
I have been working on some other bits of the site for the last few days, but as deadlines loom closer I am having to revisit this bit!
I have had another few tries, and now have the movies loading in the correct place on the stage and the overall animation is as the client wants - however....
It now appears that the animation within the loaded clips is not running (a simple rollover).
If you would be so good as to have a look at my code and files, then prepare a large wet kipper and slap me round the face with it until I see where I have gone wrong I would be most grateful!
The 'master' movie is called sidenav-menu.
Kind regards,
Gordon
Attached File(s)
-
MyProblemMovie.zip (73.72K)
Number of downloads: 1
#7
Posted 05 August 2008 - 10:35 AM
Hello
*Slaps Gordon round the face with large wet kipper*
Try this :
mc.onRollOver = function() {
mc.gotoAndPlay(2);
}
mc.onRollOut = function() {
mc.gotoAndPlay(11);
}
In the sidenav-menu, put the above code between the mc.onRelease function/break; for each case in the switch statement - not including the default case at the bottom of the switch.
Rob
*Slaps Gordon round the face with large wet kipper*
Try this :
mc.onRollOver = function() {
mc.gotoAndPlay(2);
}
mc.onRollOut = function() {
mc.gotoAndPlay(11);
}
In the sidenav-menu, put the above code between the mc.onRelease function/break; for each case in the switch statement - not including the default case at the bottom of the switch.
Rob
#8
Posted 05 August 2008 - 11:33 AM
Roberto, on Aug 5 2008, 11:35, said:
Hello
*Slaps Gordon round the face with large wet kipper*
Try this :
mc.onRollOver = function() {
mc.gotoAndPlay(2);
}
mc.onRollOut = function() {
mc.gotoAndPlay(11);
}
In the sidenav-menu, put the above code between the mc.onRelease function/break; for each case in the switch statement - not including the default case at the bottom of the switch.
Rob
*Slaps Gordon round the face with large wet kipper*
Try this :
mc.onRollOver = function() {
mc.gotoAndPlay(2);
}
mc.onRollOut = function() {
mc.gotoAndPlay(11);
}
In the sidenav-menu, put the above code between the mc.onRelease function/break; for each case in the switch statement - not including the default case at the bottom of the switch.
Rob
After I have wiped the kipper residue from my face I will give it a go...
..thanks very much again Rob!
Regards
Gordon
#9
Posted 05 August 2008 - 12:20 PM
Rob you are a legend!
Cannot thank you enough for your help.
Maybe one day I will actually understand how it works!
I owe you a drink!
Regards,
Gordon
Cannot thank you enough for your help.
Maybe one day I will actually understand how it works!
I owe you a drink!
Regards,
Gordon
#10
Posted 07 August 2008 - 11:02 AM
I have still got a small problem with this movie - sometimes when you click on a link in the movie it attempts to load an 'undefined page'. Not the same on every page using the movie so it may be a loading issue???
Any suggestions on how I can make it more stable?
Regards,
Gordon
Any suggestions on how I can make it more stable?
Regards,
Gordon
#11
Posted 07 August 2008 - 12:35 PM
Hello
Can you zip/post your files again, so I can see whats going on or send them as an attachment in a PM.
Rob
Can you zip/post your files again, so I can see whats going on or send them as an attachment in a PM.
Rob
- ← [FLASH 8] Buttons in external SWF's loading content
- Flash, Actionscript & RIA
- How do You do that... →
Share this topic:
Page 1 of 1
Help
















