Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Button Calling Pdf Document - Help



Hi, I am having difficulty getting a button on my flash site to call a pdf document stored in the same place as the movies.
Could you advise please on how i can get it to retreive the pdf document then display it using acrobat, or directing to a site to get the acrobat reader, and then returning to the website.
I have searched the internet and different forums but nothing seems to help.
I have tried using getURL as actionscript on the button but all i get is a blank page which appears to be pointing to the website as a whole.
Your advise will be appreciated as i am getting very frustrated by it.
I have upgraded to flash 8 with all the website having been designed originaly in flash mx by a different webmasterand who is unavailabe to help.
I am in the process of revamping the site to include new features but the original site can be found at www.jackpad.co.uk.
Thanks in advance
Roger
ps I also posted this in the coffee lounge perhaps in error - sorry



FlashKit > Flash Help > Flash ActionScript
Posted on: 03-21-2006, 03:48 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Cross Document Function Calling?
Ok here's whats going on.
For this example, i have 3 files.
Main.as, Content.as, Home.as

Main is the document class for the root stage, has some functions to load in Content.
Home extends Content.
Main loads Home.
Main has a function to load some modal alert window.
I want to call the function from home(content).

I can't call Main.loadModal(); so how do I reference the instance of Main directly? I just don't get where or how that would be done?

Should I be creating a class like Utility.as and store stuff in there like a variable for referencing the instance of main?

I'm just really confused, if these needs elaborating let me know, thanks.

Calling Html Document Into Dynamic Textbox?
hello, my subject says it all.
I have tried using this as a method...
(dynamic text box var=news)

news=getURL ("news.html")

now all that does is load an external page,
i want the contents to load into the dynamic text box,

Im really trying to make a news scroller,
that is easily updated and can contain html, such as links and what not....

anyhelp please???

Calling The Document Class From Other Object Instances
I have a Flash CS3 fla with a document class specified. Lots of other classes exist, too, and they're directly or indirectly spawned from the document class. I can pass "this" as a parameter from the document class to instances I create so that those child objects have a reference to the document class. But it seems to me that I shouldn't need to do that. That all children must "know" what the document class is.

Is that true? If it is, how to I talk to the document class from other object instances in my project? In other words, what's the syntax to reference a method in the document class?

Webservices -- Calling A WSDL Document In A Protected Directory
Hello all,

I am trying to call an external PHP script file (it's a SOAP server script) file from within Flash. Now, the directory the php script is in is password-protected, so my call to the webservice function is like so:

// Initialize the WebService Class here
wsdl = new mx.services.WebService("http://username:password@www.test.com/soap/server.php?wsdl");

I get an error saying "Error Opening URL blah blah"

Now, I tried taking the username/password off of the directory and made my call like so:

// Initialize the WebService Class here
wsdl = new mx.services.WebService("http://www.test.com/soap/server.php?wsdl");

And it works fine, no errors.

What could I be doing wrong?

PS -- I know the username/password I am using are correct, so that's not the issue

Thanks!

Webservices -- Calling A WSDL Document In A Protected Directory
Hello all,

I am trying to call an external PHP script file (it's a SOAP server script) file from within Flash. Now, the directory the php script is in is password-protected, so my call to the webservice function is like so:

// Initialize the WebService Class here
wsdl = new mx.services.WebService("http://username:password@www.test.com/soap/server.php?wsdl");

I get an error saying "Error Opening URL blah blah"

Now, I tried taking the username/password off of the directory and made my call like so:

// Initialize the WebService Class here
wsdl = new mx.services.WebService("http://www.test.com/soap/server.php?wsdl");

And it works fine, no errors.

What could I be doing wrong?

PS -- I know the username/password I am using are correct, so that's not the issue

Thanks!

Calling Javascript Document.write From Actionscript Hangs Browser
Whenever the following code is run from Flash, the browser hangs. Any ideas why and does anyone have any possible workarounds where the javascript is all internal to Flash?


ActionScript Code:
ExternalInterface.call('myFunc(){document.write(<style type="text/css">.myDiv{color:#fff;}</style>');

Calling A Function In Main Class From A Loaded Swfs Document Class
Hi
I have a main.swf that loads page.swf. They each have a document class called "Main" and "Page".

How can I call a function in Main from Page?

In AS2 this would be somthing like _parent.myFunction();


Cheers

A Button That Downloads A Pdf Document
Hi ya
how do you go about creating a button that downloads a pdf document.

cheers

foxie

Load Document With Button
how would i tell a button to load a word document directly and the file will be with the flash document as well.

Load Document With Button
how would i tell a button to load a word document directly and the file will be with the flash document as well.

Flash MX Button Is Not Linking To Document
Hi, I created my own flash mx button and now I'm trying to link it to one of my web page documents. I'm not sure on what action script to apply to achieve this. Once I click on the button and release it the page I want to link the button to should open right up. But it doesn't. What should I do?

Button Link To Word Document
Hi!
I have been searching everywhere but can`t seem to find a place that explains me how to get a linked button to open a word document in Word itself.. Anyone here that can help? I am working in Flash MX..

Thanx

Button Event Within My Document Class
Hi. I have the following code:

proceedBut.addEventListener(MouseEvent.CLICK, myLink);
function myLink(event: MouseEvent) {
var linkMain:URLRequest = new URLRequest("http://www.myURL/home.html");
navigateToURL(linkMain,"_self");
}

If I place a Movie Clip on my stage, give it the instance name "proceedBut" and place the above code on the same frame of my timeline, it works perfectly.

If I am using the document class 'Main.as', where does this code appear in the package?

When I do this:

package {
import flash.display.Sprite;
import flash.net.navigateToURL;
import flash.net.URLRequest;
public class Main extends Sprite {
public function Main() {
proceedBut.addEventListener(MouseEvent.CLICK, myLink);
function myLink(event: MouseEvent) {
var linkMain:URLRequest = new URLRequest("http://www.myURL/home.html");
navigateToURL(linkMain,"_self");
}
}
}
}

I get the error:
1046: Type was not found or was not a compile-time constant: MouseEvent.

Please help

How Can I Open A Word Document With A Flash Button?
How can i have a button in my flash animation open a word document in a new window? Is there anyway i can also make it close the flash animation as it opens the word document in the new window? Thanks.

Printing A Word Document From Flash Button
Can anyone tell me how to program a button in flash to print a word document.

Any help greatly appreciated.

Kiwiteen...

Reference A Button On Stage In Document Class
Hey guys,

I was wondering how I would go about getting to a button that is NOT made programatically from the document class? Let's say I drag a box on and convert to a symbol and give it an instance name of myBox. in my document class how would I go about accessing it's properties?

Thanks!

Button Visible In Document Class Constructor
Hi there,

I want to make a button hidden by using Button.visible = false in my document class constructor.

I have added some code like this:


ActionScript Code:
public class MyClass
{
    public function MyClass()
    {
        myButton.visible = false;
    }
}

Now the problem is that the button is not hidden!
I can use the same code in other places, like in frame code or in another button click handler. I can also hide movieclips using the visible property in the constructor.
Some other properties of the button seems to work in the constructor, like x and y position.

Being very new to actionscript I was wondering what I am doing wrong or maybe this is a bug in AS3?

I have tried to search so pardon me if I've missed the answer. Also, I have no clue if my terminology is correct so please bear with me

Thanks in advance,
Ronzan

Button Linkage To A Document Or Photo Instead Of A Webpage
Hi,
I am new to Flash MX. How do I link a button to a document or photo instead of a webpage
I can complete the following steps:
>Use the Script Action>Select Global Function> Browser/network> getURL-

Actionscript For A Button To Print A File/document
What is the actionscript to assign to a button in order to open a file/document that will be included on the same cd rom as my flash EXE interface?

Any help would be appreciated.
Not looking for third party solutions just the scripting required for the flash exe to locate the file from the cdrom and print to the users printer.

Thanks!
Meg

Document Class Access Of Button On A Specific Frame
I have a button that exists on a certain frame in my flash movie. I'm getting a null reference error when I try to compile the movie. Here's what the trace window reports:

onConnect1 running! chatService has connected.
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at MethodInfo-289()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at net.flashmog::FlashMOGService/socketConnectHandler()


The code is attached.







Attach Code

package {
import fl.controls.TextArea;
import flash.display.MovieClip;
import flash.events.*
import flash.text.TextField;
import net.flashmog.FlashMOGService;

/**
* A simple chat application.
*/
public class ChatExample extends MovieClip {
private var lastErrorMessage:String = '';
private var chatService:FlashMOGService;

public function ChatExample() {
this.stop();
chatService = new FlashMOGService('11.22.33.44', 1234, 'chatService');
configureListeners();
chatService.connect();
}

private function configureListeners():void {
chatService.addEventListener(Event.CONNECT, onConnect1);
function onConnect1(evt:Event):void {
trace('onConnect1 running! chatService has connected.');
gotoAndStop('username');


function submitClick(evt:MouseEvent) {
if (usernameText.length > 0) {
usernameStatusText.text = "Registering username with server...";
chatService.server.registerUsername(usernameText.text);
} else {
usernameStatusText.text = "You must enter a name!";
}
}
submitButton.addEventListener(MouseEvent.CLICK, submitClick);

} // onConnect
} // configureListeners
} // class ChatExample
} // package

Flash Button Makes Iframe Load To Another Document
I have a html document with a iframe in it and the flash nav.the iframe is named "iframe"(who woulve guessed I have a button with the code this in it

PHP Code:



on (release) {    getURL(("d2.html", "iframe"), _self);} 




obviously that doesn't work
i want it so when i click the button in the flash nav. the iframe goes to another flash document called d2.html

i hope you understand
-cxn

Txt Calling Button
Hi,
I am trying to make button using txt file.
how can centralize my button title?
how do we make smooth our txt file when we call into flash.?
i am using notepad editor for txt file.I am replacing<p align justify> command but still my txt file is not looking good.
and also there are big space between two lines.
what shoudl i do?
thank you

Calling MC From Button?
Hey guys...

i have a buttonBTN... inside my buttonBTN i have a movieMC with instance name movie...

on the movieMC i have a onClipEvent(load){ trace ('hit); }

however... when i do a Ctrl+Enter... i never see the 'hi'...

i dont know whether its because you can't movie instances under a button? (im confused!)

please advice...

thanks

Is It Possible? Button Calling Scene In A MC?
Hello,

I am running into a problem here I don't know how to deal with.

I have a button in the timeline where a user click on it and it should see a mc. The MC contains different label names of scenes. What kind of action script should I use to call scene1, scene 2 etc from the MC? The MC is also placed on the timeline, same scene as the button.

I hope there is a way to do this. Thank you,

Button Calling Mc Trouble
I have a full nav setup and all works fine. The problem I'm having is that when you hit a particular button to call on the mc it loads fine but if the user should happen to rehit that button it goes back to frame 1 ready to be hit and played again. I need this to stay loaded if hit again. If you hit any other button they exit fine also. Any help would be greatly appreciated.

Thanks

Calling Button Instance Name
Hi All!!

I'm writing some actionscript for a button, but I can't get the button's instance name as a string? Anyone know how would I get the button's instance name into a string?? Sorry if this is a bit of a newbie Q.

thanks all

Calling A Function From A Button
I have a function that is in the action layer. What this function will do is check to see what the current frame is and if it is between a certain range of frames got to this frame. Mu problem is I dont know how to call a function from a button. Could some one help me please on how to call a function from a button ( on (release)....)

Oh yeah I am using MX

Calling A Function Without A Button... Please Help
Hi all,
I need some help with a function thats being activated by 4 different buttons but now I need the buttons removed and have the effects looping, the four of them. I just need an automatic animation now rather than a button driven one.
The effect is a automatic slide show with masking effects like this one (flash MX)
http://www.creatif.net/staff/andy/one/LAYOUT3.htm


the script goes like this where I believe the change is needed;

button1.onRollOver = function() {
button1._x++;
button1._y++;
selectPicNum = 1;
picPlay = true;
};

button2.onRollOver = function() {
button2._x++;
button2._y++;
selectPicNum = 2;
picPlay = true;
};

and so on...

Please.....
thanks in advance

Calling Scene2 From A Button Within A MC
My Scenario:

There are two scenes 1 and 2. I have placed a movie clip on Scene 1. Within this movie clip i have placed a button. The action of this button is to go to and play Scene 2, frame 1.

This aint working for me..??!! can anyone pls. tell me a solution.

I cannot place the button on root of the main scent..

TIA..

Button AS Calling Mediaplayer
I created some flashbuttons wich have to start a radiostream in windows- mediaplayer wich is embeded on the same page!

So I have to use Javascript i think? It has to be something like this http://scripts.planet.nl/radio/index.php?br=pi Press the flashbutton and open in mediaplayer on the page.

Does anybody have such a script or a suggestion where to search?

Calling A Button Instance
Hi,

I can only apologise if this is the most stupid question of the day but I cannot find the answer any where else.

I am in the process of writing a flash site, written in one frame using actionscript to control items to only appear when I call them.

At the moment I am using:

this.attachMovie("appleblink", "appleblink", 5001);
appleblink._x = 450;
appleblink._y = 128;
;

to call a movie symbol when the site loads.

And am using:

back_btn.onRelease = function (){
unloadMovie("appleblink");
};

to remove the loaded movie using a static button that is on the stage.

Both of these above commands work well.


I also have code on the site that calls a movie when a static button is pressed:

m01_btn.onRelease = function (){
unloadMovie("appleblink");
this._parent.attachMovie("type00", "type00", 5002);
type00._x=30;
type00._y=100;
};


I am trying to find a way to use actionscript to call a button (rather than a movie symbol) to appear at certain coordinates when another static button is pressed.
I was hoping that something like:

m01_btn.onRelease = function (){
this._parent.attachButton("button00", "button00", 5005);
type00._x=30;
type00._y=100;
};

might work but obviously attachButton is not an actionscript command.

Does anyone know of a way in which I can call a button symbol using actionscript and also the equivilent of unloadMovie("moviename") so that I can remove it again when pressing another static button.

Thanks in advance,

Sam

Calling A Function From A Button?
Hi, I have searched around for half an hour and cant find anything that helps so I had to make a post

I am trying to get a button to call a function and give it a varable....

Code on button....

Code:
on(release){
trace("test");
sPage = "contact";
selectpage(sPage);
}
code inside timeline

Code:
function selectpage(sPage):Void {
trace("test2")
switch(sPage){

case home:
trace("home")
case about:
trace("about")
case portfolio:
trace("portfolio")
case services:
trace("services")
case contact:
trace("contact")
}
}
here is a pic of where the code is located....

http://img241.imageshack.us/img241/1...titled1ed6.png

there is more code in that frame including a stop();

Cheers for any help

Having Trouble Calling Button
how come my button works if i put the code directly into the button but when I try using code on the main stage timeline it wont call the button....


Code:
this.menu.contactbutton.onRelease = function()
{
trace("contact");
}
the button is located....

"mainstage > menu > contactbutton"

sorry for the noob question but it is really annoying me

Calling Function From Button.
Should this work?

This is at my root. if I trace just lessonList[lessonid].firstChild I get what I am looking for.

Code:
function slideMain(){

slideList = lessonList[lessonid].firstChild;

//set all variables to names parsed from the XML
vSlideMain.slideNumber = slideList.attributes.slideNumber;
vSlideMain.text_1.text = slideList.attributes.text_1;
vSlideMain.text_2.text = slideList.attributes.text_2;

trace(slideList);
}
then I have this code on a button a few levels deep.


Code:
on(release){
_root.lessonid = 4;
_root.slidemain();
}
What I am trying to do is, everytime the button is pushed i want it to reload the function with the new variable of lessonid. by default lessonid equals 0. If I trace(_root.lessonid); the output changes to 4 on the release, but slideMain doesnt output anything. Am I calling this function right?

Calling A Function From A Button
I'm trying to call a simple function, that is located on the first (and only) frame on the _root, from a button that is one layer deep.

on _root (I've simplified it to narrow down the error possibilities and its still not working):

function moveTab() {
trace("calling function moveTab()");
}


then on the button I have:
moveTab();

What could I possibly be doing wrong???

thanks,
E

Calling Function In Another Button?
I have 2 Movie Clips which create a menu system. When you hover the mouse over the 2nd button (will be adding more as soon as I figure this road block out) it drops down a menu.

[Home][Forums]

In the movie clip of "Forums", I created 2 labels. 1 is for "collapsed" and 1 is for "expanded". Expanded shows the dropped down menu.

I created a hidden button in the "Expanded" display (sits under the buttons of the menu) so if you mouse over it, it will collapse the menu.

However, because the 2 top movie clips are right next to each other the hidden button never gets triggered because the [Home] movie clip sits on top.

I figured the easiest way would be to simply call the "collapsed" label in the movie clip for "Forums", although I don't know if this is possible or how to achieve it.

The following is what I attempted to use in the ActionScript section of the movie clip for [Home]:

stop();
function collapsemenu(myevent:MouseEvent):void {
mcForums.gotoAndStop("collapsed");
}
btnHome.addEventListener(MouseEvent.MOUSE_OVER, collapsemenu);

When I do this, it gives me the following error:
1120:Access of undefined property mcForums

Any help or feedback appreciated!

Calling A MC From The Library With A Button
Hi,

I have created a movie clip in the library and a button on my stage that I want to play the Movie Clip.
I need a simple code that will call the movie clip when the button is pressed and then when the user wants to close the movie clip I want them to be able to do that via a button inside the movie clip.

I know this is a very simple question and any help would be much much appreciated.

Thanks

Jacq =)

Calling Button Within A Movieclip
i have a movie clip called menu
there is a button in the movie clip called button1
how do i use that button from the main timeline
i was guessing to do:
menu.button1.onRelease { whatever action }
but its not working

how would i do that
p.s. i need to be able to run the release code in the main timeline, not the button's timeline

thanks

Calling A Function With A Button
Join Date: Sep 2007
Posts: 2

Calling a function within a class
Hi I have created a basic class that says hello when the runs but I want to know how to call the sayGoodBye() function with a mouse click on a button or movieclip. The button/movie does not belong to this class

Thanks,


package {
import flash.display.*;
import flash.events.*;
import fl.transitions.*;
import flash.display.MovieClip;


public class Greetings extends MovieClip

{



public function Greetings()
{
trace('hello');


}


public function sayGoodBye()
{
trace('see ya');
}

Calling Button Within A Movieclip
i have a movie clip called menu
there is a button in the movie clip called button1
how do i use that button from the main timeline
i was guessing to do:
menu.button1.onRelease { whatever action }
but its not working

how would i do that
p.s. i need to be able to run the release code in the main timeline, not the button's timeline

thanks

Calling .as File From A Button
Can anyone give me any idea upon how i can call a .as file in a flash button ?

Button Calling MC Using _parent?
ok I've got this button place in a mc "Front" and whats it's calling is a "mc_Menu" . When I test the movie I get in the output window...

Target not found: Target="mc_Menu" Base="_level0.menuclip.front1"

here is the code on the button

Code:

on (release) {
tellTarget("mc_Menu") {
_parent.gotoAndPlay("Play BW");
illus = "BLACK & WHITE";
}
}
any ideas?
~Babalou

Calling A Button On Frame 2?
Driving me crazy. Been looking for this for 2 hours now.

I have a button,

Code:


_root.MainMovie_mc.innerMovie_mc.button_mc


That is on frame 2 of a movie. I want to attach an onRelease action to it, but I can't figure out how. I figured its something like:

Code:


_root.MainMovie_mc.innerMovie_mc.frame(2).button_mc


or give the frame a label and add the label name to the path:

Code:


_root.MainMovie_mc.innerMovie_mc.frameTwo.button_mc


or something, but can't find it to save my life.

This is a button inside a contact form movie, and what I did was, I added a frame to the beginning of the movie, and now buttons are just borked. My button actions are all in an .as file, but putting the actions on the buttons or not makes no difference. If I take that frame out, everything is beautiful again.

This would be the end result on one of the buttons:

Code:


_root.MainMovie_mc.innerMovie_mc.button_mc.onRelease = function(){
trace("Got Back Button!");
_root.MainMovie_mc.innerMovie_mc.gotoAndStop(1);
}



Please help. I thought finding the syntax for this would be pretty easy, but I guess not.

**EDIT

Up to this point I've done a trace on the button with, and without the new frame:

Code:


trace(_root.MainMovie_mc.innerMovie_mc.button_mc);


and with the new frame at the beginning, the trace comes up blank. Take the frame out, and it traces _level0.MainMovie_mc.innerMovie_mc.button_mc.

I'm going nuts. There has to be a way to access this button on a different frame then the first. I've been through my actionscript book, googled as relevantly as possible, and nothing.

Calling An <href> From A Flash Button
can i call an href function from a flash button?
additionally it target=_top

thanks.

Calling A Function From A Button On Another Level Mc
I am trying to make a menu that is on a high level (66) and I want the buttons on this movie clip to work with functions I have on the actionscript of my base movieclip. here is some of the code:


Code:
// here I am making a movie with instance name sixtysix, on level 66.
_root.createEmptyMovieClip("sixtysix", 66);
sixtysix._x=0;
sixtysix._y=0;
loadMovie("scripts/lesson-menu.swf","sixtysix");
// it loads the file from the directory, this works.

// my attempt to target the button to call the desired function
_root.sixtysix.lessonMenu_mc.ls3.onPress = function() {
_root.lesson3Start();
}


I have a function called lesson3Start that I want a button in that movie clip (instance sixtysix) to trigger. to test it, I made a button with the same code but on the base MC, and that does work.

In the file "lesson-menu.swf" there is a movie clip with instance name "lessonMenu_mc" and a button in that clip with an instance name "ls3". The reason I need this menu to be in level 66 is because it has to load over other layers. I have checked and double checked the instance names and they are correct. I can only assume there is some kind of issue with how I am targeting it or a problem with the layers communicating with each other?

I have also tried _level66.lessonMenu_mc.ls3.onPress and that does not work either!

Any help would be really appreciated!

Calling Up Variables From A Button Assignment
Hello,

I have a flash project where I have 2 buttons, and whichever one is clicked determines what text is assigned to a variable, let's call it "extension" without the quotes, and text assigned to extension is either ".wav" or ".mp3" without the quotes.

I now want to verify that it is assigning .wav or .mp3 to extension. So, I have been testing by making a new third button and simply have it put the extension value in a text box. This is where the problem arises. I can have it give individual text, but I can't seem to have it carry over the extension value unless I define the extension value manually in the new third button I made. It puts "undefined" in the text box. This obviously defeats the purpose, so I am trying to find a way to get it to auto grab the already existing value, in theory, that exists by clicking one of the first two buttons.

Do I have to have more frames added to this or can it be static in 1 frame? So far it seems like I wouldn't need multiple frames.

Button Calling For Power Point
i made an flash intro for my ms power point presentation, i would like to know right after the flash intro is finish there is a flash button at the end where i click on it and it will open a new page to my ms power point presentation, can some one help with the button action, i can't seem to find how to set it. thank
dakine

Button Calling A Swf File On Press
I have created a button called View Movie and on the click of this button I want to call a .swf file. How is this done?

[F8] Button Problem, Calling Upon Scenes
I have a flash movie that is completely working with buttons. I now had to add a regular html page. I can get the flash movie button to call upon the html page but I am having trouble getting the flash navigation on the html page to call upon the flash movie with the different scenes.

Is there a way to call upon each of the individual scenes in the flash movie?

The site is posted at www.sandsmktg.com
and the problem page is the contact page( it loads really slow- any suggestions).

Thanks in advance for all help.

Taz

Copyright © 2005-08 www.BigResource.com, All rights reserved