Calling all people who use Adobe flash! - HotUKDeals
We use cookie files to improve site functionality and personalisation. By continuing to use HUKD, you accept our cookie and privacy policy.
Get the HUKD app free at Google Play

Search Error

An error occurred when searching, please try again!

Login / Sign UpSubmit

Calling all people who use Adobe flash!

vengod Avatar
6y, 8m agoPosted 6 years, 8 months ago
What am i doing wrong?

Im creating a Host movie, where 5-6 buttons will be loaded from.


However, im having difficulties coding each button to open an swf file.


Here is the code i have to try and load my ipod button.


stop();
ipod_btn.addEventListener(MouseEvent.CLICK,ipod_btn);
function ipod_btn(event:MouseEvent) {
var request:URLRequest = new URLRequest("ipod.swf");
var loader:Loader = new Loader()
loader.load(request);
addChild(loader);
}


However, it doesnt do anything and i get these complier errors


1023: Incompatible override.

1021: Duplicate function definition.


i will be grateful for any help
Tags:
vengod Avatar
6y, 8m agoPosted 6 years, 8 months ago
Options

All Comments

(5) Jump to unreadPost a comment
Comments/page:
#1
You can't call a function the same name as an object..

Edit: I'm also thinking addChild() won't work until you attach it to the parent - not sure what the parent is called though (It was _root in AS1/2 i think)- i'm not great with Actionscript 3.
#2
Don't use adobe.

Steve
Sent from my iPad
#3
razord
You can't call a function the same name as an object..

Edit: I'm also thinking addChild() won't work until you attach it to the parent - not sure what the parent is called though (It was _root in AS1/2 i think)- i'm not great with Actionscript 3.


Managed to get it working...however opens a new web page rather than in swf...

Here is completed working code so far

"
stop();

ipod_btn.addEventListener(MouseEvent.CLICK,openSwf );

function openSwf(event:MouseEvent):void
{
var request:URLRequest=new URLRequest("ipod.swf");
navigateToURL(request);
}
"
#4
vengod
Managed to get it working...however opens a new web page rather than in swf...

Here is completed working code so far

"
stop();

ipod_btn.addEventListener(MouseEvent.CLICK,openSwf );

function openSwf(event:MouseEvent):void
{
var request:URLRequest=new URLRequest("ipod.swf");
navigateToURL(request);
}
"


That doesn't surprise me - i didn't even realise you could include an external SWF in another one. I'm pretty sure you'll have to load each movie as a scene in the same file, and jump to that scene on button click instead.

That how i'd do it, but i'm probably wrong!

Edit: Okay fine, i got way too interested and looked it up.

You need a movieClip on stage and named:
myMovieClip.loadMovie("myExternalMovie.swf");
#5
razord
That doesn't surprise me - i didn't even realise you could include an external SWF in another one. I'm pretty sure you'll have to load each movie as a scene in the same file, and jump to that scene on button click instead.

That how i'd do it, but i'm probably wrong!


Nah, scences have been mentioned before. But ive never used multiple scences. to be honest, i hate flash. But its part of my course so gotta do it :)

Post a Comment

You don't need an account to leave a comment. Just enter your email address. We'll keep it private.

...OR log in with your social account

...OR comment using your social account

Thanks for your comment! Keep it up!
We just need to have a quick look and it will be live soon.
The community is happy to hear your opinion! Keep contributing!