PDA

View Full Version : PLEASE help me out!!! This is killing me!!!



sundazefosho
July 5th, 2005, 02:57 AM
i have buttons in my library. I try to put the code


getURL("http://www.blahblah.com", "_blank"); into it when i edit it from the library but it always says "current selections can't have actions applied to it". How do i get to it so i can have a link pop up when i click the button? does the "getURL" also work for files on my computer? for instance i want to click a button and have a movie pop up from one of my folders on the c drive. what would i code to do that? thanks SOOOOOO much to whoever can help me out, i have been trying to do this for days...

smoothhabitat
July 5th, 2005, 03:27 AM
Place the library item on the stage. This creates an instance of the button. Then click on the button and open up the actions panel. You'll want it to say:

on(release) {getURL("http://www.blah.com","_blank");}

sundazefosho
July 5th, 2005, 11:52 PM
man i just am not gettin it. i have spent hours trying differnent ways.
sometimes it says

**Error** Scene=Scene 1, layer=menu, frame=1:Line 5: Statement must appear within on handler
getURL("http://www.blahblah.com", "_blank");
Total ActionScript Errors: 1 Reported Errors: 1

should i just post an .fla like it so you guys know what im talking about?

joncom
July 5th, 2005, 11:55 PM
you are editting the button from within the library... to give it a url, you must bring it onto the stage.

sundazefosho
July 6th, 2005, 12:13 AM
oh i know that it has to be on the stage now. the file i want it to go to is


getURL("C:\DocumentsandSettings\NilsVogna\MyDocuments\More Vids\Draft\Eric.Williams_mixmakers.net.wmv", "_blank");

when i click on the link in the .swf file it always says,

"Cannot find "file://C:\ocumentsandSettings\ilsVogna\yDocuments\oreVids \raft\ric.Williams_mixmakers.net.wmv'. Make sure the path or Internet addresss is correct.


......?

meanpeople
July 6th, 2005, 01:08 AM
copy the file you want to get into the same folder youe saved you .fla.
and use getURL("filename","_blank");

Seb Hughes
July 6th, 2005, 11:05 AM
man i just am not gettin it. i have spent hours trying differnent ways.
sometimes it says

**Error** Scene=Scene 1, layer=menu, frame=1:Line 5: Statement must appear within on handler
getURL("http://www.blahblah.com", "_blank");
Total ActionScript Errors: 1 Reported Errors: 1

should i just post an .fla like it so you guys know what im talking about?

Yeah

you need to set a event,

on (release) {
//enter code what you want to happen when you press the button
}

virusescu
July 6th, 2005, 11:28 AM
@sundazefosho Have you at least considered, ever, going through the tutorials that come with the Flash package?
Putting an action on a button is as elementary as it gets when it comes to AS coding.
It's so basic I couldn't even find help on the topic :). Try reading this though maybe it clears things out a little... http://www.macromedia.com/support/flash/action_scripts/event_methods/event_methods02.html

booler
July 6th, 2005, 12:34 PM
use more useful thread title please!