|
-
Flash novice needs urgent help
I'm sure this is going to take you 2 seconds to answer I am getting this error message:
1151: A conflict exists with definition listenerObject in namespace internal.
Description: var listenerObject:Object = new Object();
This is my overall code:
var listenerObject:Object = new Object();
listenerObject.onLoadInit = function(target_mc:MovieClip) {
target_mc.onRelease = function() {
getURL("http://www.nationalrentalaffordabilityscheme.net.au/default.aspx?page=AboutUs", "_blank");
};
};
What am I doing wrong?
-
var listenerObject:Object = new Object();
instead
var listenerObject = new Object();
-
Ok so....
var listenerObject = new Object();
listenerObject.onLoadInit = function(target_mc:MovieClip) {
target_mc.onRelease = function() {
getURL("http://www.nationalrentalaffordabilityscheme.net.au/default.aspx?page=events", "_blank");
};
};
... It's not working still
-
I dont get why you have all the extra code. all i see is your trying to go to a website from a button you created
why not just
do this
target_mc.onRelease = function()
{
getURL("http://www.nationalrentalaffordabilityscheme.net.au/default.aspx?page=events", "_blank");
};
Why do you need to make a new object I guess i just dont know what your really doing?
explain what its sopost to do.
Last edited by Mancent; 09-19-2010 at 11:12 PM.
-
Well ... Because when I do that it comes up with even more errors
1120: Access of undefined property target_mc.
and
1180: Call to a possibly undefined method getURL.
Basically all I want to do is add three links into my flash for three different buttons - Is there another way you can think for me to do this? Is there anyway I can send you where I am at for you to have a look at?
Like I said, I'm a complete novice!
-
No getURL in AS3. Is that what you are using?
Video Man
-
sorry you've lost me!
what do you mean " No getURL in AS3. "
-
getURL in Actionscript 3
One of the bigger changes in Actionscript 3 is the way in which you call a link.
Flash 9 has been out for a few weeks now and Actionscript 3 is all the rage, but some things have started to confuse people. One of those is where getURL() disappeared to.
The old way (Actionscript 2) was to do it like this.
Actionscript Code:
getURL("urltoload", "target");
In Actionscript 3 there is a little more to it.
Actionscript Code:
var url:String = "http://site"; var request:URLRequest = new URLRequest(url); try { navigateToURL(request, '_blank'); // second argument is target } catch (e:Error) { trace("Error occurred!"); }
The more obvious difference is a call to the URLRequest class and pass that response into the navigateToURL() method.
Now if you wanted to rig this call to a button you would just set up a simple Event handler
Actionscript Code:
movieClipName.addEventListener(MouseEvent.CLICK, callLink); function callLink:void { var url:String = "http://site"; var request:URLRequest = new URLRequest(url); try { navigateToURL(request, '_blank'); } catch (e:Error) { trace("Error occurred!"); } }
Tip: If you wanted to use this example in Flex or an all Actionscript project you would want to include the necessary classes.
-
I am using Flash CS3 is that AS3? or AS2?

This is a basic image of what I am doing - you see the buttons on the side - I am trying to link each of these to the links - this might help you understand what I am trying to acheive
-
it can be either or.
you have as1 as2 as3
actionscripts.
flash 8 mostly used as1 and as2 flash 9 works mostly on as2 as3.
your at flash 10 same as me but you can contorl whay type of project you want when start the project.
you can also look at your file tab at the top and change the publish settings to what script you want to use.
goto file at the top of flash
goto publish settings
now hit the tab flash you will see a dropdown menu that says script.
good luck.
-
-
Ok That is a huuuge help ... Thanks for that!
I have managed to get it up with no errors however last question... any ideas why my links arn't actually doing anything? I try and click on them but they go no where!
-
I can't open your first link - but I did the second link - that earth thing looks really cool!
-
I have flash version cs4 maybe thats why you can open the fla file. sorry thought you had the latest flash cs3 would open cs4.
thanx thats my project called wiistream. if you register and login you can watch movies and do other stuff in time its a hard project. I cant seem to get a stupid image holder to be set to a default size no mater how big the picture is right now thats holding me up on the profile page.
-
Let me know when you've finished the project it is really good!
Do you know of any reason why my links arn't working? There isn't any errors anymore but the links just don't work!
-
I really cant see what you got going on. I dont know if your useing as3 or as2.
But I can tell you what I would do
open flash
goto file new
goto flashfile actionscript 2.0
then goto save file rename it banner
now goto file import import to libary your banner image you have.
Now goto your timeline and make 3 layers and name them
Action
Buttons
Banner
The Action Timeline will be your code clip.
The Buttons Timeline will be where your three buttons are.
And your Banner timeline will be your banner image.
Ok go to the action timeline frame and click the right mouse and look for Action then open that up
The code you want is this.
Actionscript Code:
stop(); button1.onRelease= function() { getURL("http://somelink.com/index.php","_self"); }; button2.onRelease= function() { getURL("http://somelink.com/index.php","_self"); }; button3.onRelease= function() { getURL("http://somelink.com/index.php","_self"); };
Now go to the timeline buttons and click the center of the design page and draw a box with your drawing tools.
Then right click the box you just drew and create a button.
Now click that button and look for properties box and give the button a instance name
button1.
repeat 2 more times.
-
Well you have the client wiistream.exe if ther is any updates you will know becasue it tells you. its updated every day but i upload once a week.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|