Web Design Forum: Implement getURL on seperate Flash loadMovie items - Web Design Forum

Jump to content

WDF
WDF Premium Memberships Reseller Hosting
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Implement getURL on seperate Flash loadMovie items Rate Topic: -----

#1 User is offline   Gordon MWS 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 42
  • Joined: 26-July 08
  • Reputation: 0
  • Location:Lossiemouth, Scotland
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

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)
0

#2 User is offline   Roberto 

  • Rain Dog
  • PipPipPipPip
  • Group: Members
  • Posts: 532
  • Joined: 19-August 07
  • Reputation: 2
  • Gender:Male
  • Location:Suffolk
  • Experience:Intermediate
  • Area of Expertise:Coder

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

Attached File(s)


0

#3 User is offline   Gordon MWS 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 42
  • Joined: 26-July 08
  • Reputation: 0
  • Location:Lossiemouth, Scotland
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

Posted 30 July 2008 - 01:19 PM

View PostRoberto, on Jul 30 2008, 13:01, said:

Let me know if you need the code explaining.


Nice one Rob, will have a look and see if I can work it out...

...still a newbie with AS so I am on a steep learning curve!

Thanks

Gordon
0

#4 User is offline   Gordon MWS 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 42
  • Joined: 26-July 08
  • Reputation: 0
  • Location:Lossiemouth, Scotland
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

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?)
0

#5 User is offline   Roberto 

  • Rain Dog
  • PipPipPipPip
  • Group: Members
  • Posts: 532
  • Joined: 19-August 07
  • Reputation: 2
  • Gender:Male
  • Location:Suffolk
  • Experience:Intermediate
  • Area of Expertise:Coder

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
0

#6 User is offline   Gordon MWS 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 42
  • Joined: 26-July 08
  • Reputation: 0
  • Location:Lossiemouth, Scotland
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

Posted 05 August 2008 - 09:10 AM

View PostRoberto, on Jul 30 2008, 15:40, said:

If this does not help, zip your files and post them.

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)


0

#7 User is offline   Roberto 

  • Rain Dog
  • PipPipPipPip
  • Group: Members
  • Posts: 532
  • Joined: 19-August 07
  • Reputation: 2
  • Gender:Male
  • Location:Suffolk
  • Experience:Intermediate
  • Area of Expertise:Coder

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
0

#8 User is offline   Gordon MWS 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 42
  • Joined: 26-July 08
  • Reputation: 0
  • Location:Lossiemouth, Scotland
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

Posted 05 August 2008 - 11:33 AM

View PostRoberto, 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


After I have wiped the kipper residue from my face I will give it a go...

..thanks very much again Rob!

Regards

Gordon
0

#9 User is offline   Gordon MWS 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 42
  • Joined: 26-July 08
  • Reputation: 0
  • Location:Lossiemouth, Scotland
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

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
0

#10 User is offline   Gordon MWS 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 42
  • Joined: 26-July 08
  • Reputation: 0
  • Location:Lossiemouth, Scotland
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

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
0

#11 User is offline   Roberto 

  • Rain Dog
  • PipPipPipPip
  • Group: Members
  • Posts: 532
  • Joined: 19-August 07
  • Reputation: 2
  • Gender:Male
  • Location:Suffolk
  • Experience:Intermediate
  • Area of Expertise:Coder

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
0

#12 User is offline   Gordon MWS 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 42
  • Joined: 26-July 08
  • Reputation: 0
  • Location:Lossiemouth, Scotland
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

Posted 07 August 2008 - 03:10 PM

View PostRoberto, on Aug 7 2008, 13:35, said:

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


Sure, on their way in a PM...

Regards,

Gordon
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users