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




Asfunction Javascript Safari Issue



hi all! ... hitting a wall right now with this problem. using asfunction to call out a function for javascript pop up window... all seems working with other browsers except for safari where nothing happens. i tried putting the javascript codes inside flash and tried putting it inside the html but still nothing happens on safari. strange is when i just use a regular getURL() (e.g. getURL("http://sample.com", "_blank") ), seems fine in safari.

But when i try getURL( ..some javascript code ), no response in safari.

Any thoughts, workaround on this?

Replies appreciated.



ActionScript.org Forums > Flash General Questions > Flash 8 General Questions
Posted on: 09-16-2008, 11:02 PM


View Complete Forum Thread with Replies

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

Asfunction Issue
hi

i know there are lots of posts on asfunction but i can't seem to see what is going on with these files of mine.

i have a simple test.fla and 2 txt files, marketing.txt and marketing2.txt

i've set up a function:
function loadTextFile (filename) {
trace (filename);
_root.content.loadVariables(filename+".txt");
}

the idea is that marketing.txt is loaded and at the bottom there is a 'read more...' link in the text. this calls asfunction like so:

marketingTxt=<a href="asfunction:loadTextFile,marketing2">Read more...</a>

but nothing is passed to the function. so i tried adding in a button and calling the fucntion like:
on (release) {
_root.loadTextFile("marketing2");
}

that works fine. anyone got any ideas? am i passing the wrong data type to the function?

any help is appreciated. i've attached a .zip file with the 3 necessary files.

thanks

Asfunction LoadVars:Scope Issue?
I'm trying to call a function from a text file loadVars


Code:
&<a href="asfunction:myFunction">American Association</a></p>
in my flash I have the following:


Code:
myFunction = function(totrace) {
trace("foobar");
}
function setupText() {
var spot = every.textHolder.createTextField("dt", 0, 0, 0, 514, 396);
spot.type = "dynamic";
spot.html = true;
spot.autoSize = "right";
spot.embedFonts = true;
spot.multiline = true;
spot.wordWrap = true;
spot.styleSheet = myCss.styleSet;
//////
var spot2 = drive.textHolder.createTextField("dt", 0, 0, 0, 514, 396);
spot2.type = "dynamic";
spot2.html = true;
spot2.autoSize = "right";
spot2.embedFonts = true;
spot2.multiline = true;
spot2.wordWrap = true;
spot2.styleSheet = myCss.styleSet;
loadText();
}
function loadText() {
whyText = new LoadVars();
whyText.onLoad = function() {

every.textHolder.dt.htmlText = whyText.everyText;
drive.textHolder.dt.htmlText = whyText.driveText;
};
whyText.load("whyText.txt");
}
and the asfunction is not calling the myFunction.

Any suggestions? I have tried just testing regular urls and javascript alerts...but no jive.

Could it be a scope issue, or perhaps something else.

Holla back.

Davidissimo

Loading Issue...safari
im loading a couple of galleries and one works but one that is a copy of the first just with a different initial for the images being called ( thumbB1.jpg as opposed to thumbA1.jpg ) doesnt work. in safari i get this in the activity window

file:///Users/mikeb/Desktop/yes/images/thumbb9.jpg(45)

the number (45) just keeps getting bigger and the browser hangs. what is that ?

i tried changing the names of the "A" image and thumbs to "B" and that didnt help.

Flash Safari Issue
If i am opening any popup in my application and then i logout from parent window or main screen, then if i again go to login screen there i am not been able enter username or password and my login screen is made in flash.

This case works fine in IE but this is not working in safari.

If i close safri and then try to login then its working.

Flash And Safari Issue
I've created a flash file which starts with 3 large buttons which take you to a different frame label on the main timeline. Each label contains a movie which contains various images and text.

The buttons work perfectly fine in IE7, however in firefox (pc) and on safari the third button decides to take me to the wrong section in the timeline. BUT this only happens when you click on the upper edge of the button.

Clicking anywhere else on the button is fine, it's just the top edge.

I've checked the FLA file and there's nothing odd going on as it works fine when the .SWF is run on my pc.

Any ideas why this would happen?

Safari Issue With LoadMovie
Okay, I'm frustrated.

I'm using a very simple actionscript to try and test loading external graphics, which I need for a project. It works in the Flash Player and in Firefox, but Safari seems to ignore the loadMovie command.

Here's the actionscript: loadMovie("first.swf", "first_swf");

This is actually from a tutorial from FlashKit, so I'm sure it worked for the person who made this, but they didn't have Safari most likely. The instance name is there and the movieclip is there, but Safari is refusing to see the external file it seems.

Any suggestions? I'm using OS X 10.4.8 with Safari 2.0.4 (419.3) with Flash 8.

P.S. Strange as it may sound, I went ahead and uploaded the movie and the first.swf file to my web server and tried it over the web and it worked just fine. It just won't work in a drap and drop from my computer into the browser. So, while this isn't critical now, it is strange that the OS X file system is being ignored on the loadMovie command, but it works via the web and HTTP call.





























Edited: 01/30/2007 at 10:45:27 AM by macsavers

Safari (MAC) Flash Issue
Hi there, I have a flash website - http://www.empty.com.br - and lately I have been recieving some negative feedback from Safari users.
Anyone knows what can be made to fix this issue?

thanks!

Gabriel.

Safari Browser/javascript Issue
I made a flash site where some of the buttons open the link in a new, small window. It works fine in all browsers but Safari. In Safari. the scroll arrows don't work. The code I used is pasted below. The URL for the site is:
www.vami.com
Any suggestions? Thanks! Rich


on (release) {
getURL("javascript:window.open('fred.html','fred', 'width=500,height=450,toolbar=0,location=0,directo ries=0,status=0,menubar=0,scrollbars=1,resizable=0 ,top='+((screen.availHeight/2)-(500/2))+',left='+((screen.availWidth/2)-(450/2))+'');void(0);");
}

Issue With Safari And Flash Movies
Hi, does anyone know if/what the issue is with flash movies and safari?
for some reason embeded movies dont play anymore. if you click on the play button it just progress's one frame instead of playing them all.
its fine in internet explorer.
it happens on this site:
http://www.nexuslondon.com/
for instance.

please help!

Weird Issue With A Web Flash Nav Header And Safari/Macs *PLEASE HELP*
Recently a weird bug has presented itself in regards to a site I manage and design. Here it is:

http://www.jeffhardingmusic.com

For some reason the Flash Header will not load in Macs (either in IE for Mac or Safari) The presentation was exported from Flash MX 2004, and works fin in PC's. This is a recent development, the site was working properly, then I updated the site and it began to not load.

Is there any weird bugs when it involves swfs v.6&7?

What could be causing this problem?

Thanks all
JF

Expandable Flash Banner Issue In Firefox And Safari, Perfect In IE
I put together a little expanding banner, on roll over expand, on roll out contract, and it works great in IE 6 & 7, but in Firefox and Safari, the flash content is fully expanded and it wont let you use the html content below it, since its on top, but with this same code below, it works like a charm in IE.

Any ideas on how to make it work also with Firefox and IE ?

My AS2 Code:

ActionScript Code:
Stage.scaleMode = "noScale";
Stage.align = "TL";

import com.mosesSupposes.fuse.*;
ZigoEngine.register(Fuse,PennerEasing);

function moveMask():Void{
    getURL("javascript:expand('flashid');");
    var f:Fuse = new Fuse();
    f.push({target:masker, width:450, easing:"easeOutBounce"});
    f.start();
}

function outMask():Void{
    var f:Fuse = new Fuse();
    f.push({target:masker, width:190, easing:"easeOutBounce"});
    f.start();
    if(masker.width == 190){
        getURL("javascript:collapse('flashid');");
    }
}

masker.onRollOver = moveMask;

masker.onRollOut = masker.onReleaseOutside = outMask;

My Javascript code:

Code:
function expand(divid){
document.getElementById(divid).style.clip = "rect(0px 450px 300px 0px)";
}

function collapse(divid){
document.getElementById(divid).style.clip = "rect(0px 190px 300px 0px)";
}


function makeBanner(){
document.write('<object data="publicidad/banner.swf" width="100%" height="300" type="application/x-shockwave-flash">');
document.write('<param name="movie" value="publicidad/banner.swf" />');
document.write('<param name="quality" value="high" />
');
document.write('<param name="wmode" value="transparent" />');
document.write('<embed src="publicidad/banner.swf" quality="high" width="100%" height="300" wmode="transparent" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
');
document.write('</object>');
}
My HTML Code:

Code:
<div style="visibility: visible; position: relative; width: 190px; height: 300px; z-index: 12;">
<div id="flashid" style="width: 450px; height: 300px; z-index: 11; position: absolute; overflow: hidden;">
<script type="text/javascript">makeBanner();</script>
</div>
</div>
Hopefully some one can point what I've done wrong to make it work properly in FF and Safari.

Any help greatly appreciated. Thanks!

Allen

Asfunction
Any ASFUNCTION gurus out there? I posted a form of this question already but got no response. I'm trying to make the asfunction work for me much like the gotoAndStop actionscript. I have an external text box that I want to add a hyperlink that takes me to and stops to a label on the main timeline.

////
the link in the macromedia site which gave me the example:
Note: This is equivalent to assigning "<A HREF="asfunction:myFunction,argument_1">Click here</A>" to an HTML-enabled text field variable.
////

Can't get this to work though.

So, I need some guidance for: hyperlink, gotoAndStop, label on main timeline.

This seems simple enough for someone that knows how to work with the ASFUNCTION. But that's not my bag baby. Any help would be appreciated. Thanks.

ASFUNCTION
1. I have a mc with a dynamic text box that pulls html text from an external .txt file.

2. Within this .txt file I'm trying to use "<A HREF="asfunction:myFunction,argument_1">Click here</A>

3. What I want it to do is load another .txt file into a different text field.

This is all for an FAQ seciton on a web site. I want the questions in the top text box, when some clicks on the question it didplays the answer in the bottom text box.

Reference:
http://www.macromedia.com/support/fl...asfunction.htm

Thanks for any and all help. I've hit a brick wall.

Please Help - AsFunction
Im using asFunction in my html formatted text files and its working great apart from one thing.

As soon as i put the swf in a html file it stops working.
Any ideas?

The code is:

function gsLabel(label) {
_root.gotoAndStop(label);
}

My text file has the following HREF:

<A HREF="asfunction:gsLabel,sleep">get enough good quality sleep</A>

cheers

J

Asfunction: Is This Possible?
I'm using the follwoing asfunction to send the flash player to frame 5 of my movie and it works fine:


Code:
function goto () { clickme = gotoAndStop(5); }
what I need to know is is it possible to change the frame the player goes to from the . txt that I'm using. This is because my client needs to be able to target different parts of the flash move when they update the text file.

Is there anyway this can be done??

Asfunction
hi,
I am trying to use asfunction in Html format text to call myFunction and trying to get respective argument value each time i'll click targeted word..

my arg value arrStr[index] should be different.
right now it is inside the ' ' so thats not rigth i suppose.
Chk fla file if you can help me out
thanx!
//My code.............................

myText_txt.html = true;
myText_txt.autoSize = true;
str = "Ram is a hero of Ramayan";
strnew = "Sita is mother of two kids";
var arrStr = str.split(" ");
trgWord = new Array("Ram", "hero");
var index;
for (var i = 0; i<arrStr.length; i++) {
trace("arrStr[i] = " add i add arrStr[i]);
for (j=0; j<=i; ++j) {
if (arrStr[i] eq trgWord[j]) {
trace("match");
index = i;
arrStr[i] = "<A HREF='asfunction:myFunction,arrStr[index]'><font color='#FF0000'>"+arrStr[index]+"</font></a>";
}
}
}
trace("arrStr="+arrStr);
myText_txt.htmlText = myText_txt.htmlText add " " add arrStr.join(" ");
function myFunction(val) {
dd=val
trace(dd);
}

Asfunction
Can I use Asfunction in onrollover event in a dyn input?
How?

AsFunction...
Flash movie:

function myFunction (params) {
argArray = new Array();
loadMovieNum (argArray[0], 1);
stop ();
}


HTML:

<A HREF="asfunction:myFunction,product.swf">Test</a>


The only problem is, the comma sign ( , ) is used in my text file to split records. So basically i want to know if there is a way to do <A HREF="asfunction:myFunction,product.swf"> without using the comma sign?

Asfunction
Hello

I have a function

function loadmovie(name) {
loadMovieNum(name, 1);
}


this one works fin with <a href="asfunction:loadmovie, test.swf>test</a>

juhuu the test.swf is loaden on level 1

but now i want to use

function loadmovie(name,place) {
loadMovieNum(name, place);
}

but now as i use <a href="asfunction:loadmovie, test.swf, drop>test</a>

nothing happens


what is my mistake??

Thanx in advance

Gilo

Asfunction Help
Hi how can I put an variable in an asfunction


Code:
ipNR = 0;

for (var u = 0 ; u < url_arr.length ; u++) {
ipNR++
link_txt += "<A HREF="asfunction:addPath,ipNR">"+url_arr[u]+"</A><BR>";
}

function addPath (arg) {
trace ("argument was"+arg);
}
ipNR is a variable that keeps changing but what I have now is.. that the trace always put out "ipNR" instead of the counted nr..

Asfunction
I want to ad a gotoANDPlay() function to a piece of text in my website with using asfunction but whatever I try it doesn't work...

I select a piece of the text and fill in asfunction:gotoAndPlay(15) (on the place where you normally put a link in properties)in the hope when I click on that piece of text that in the swf it will go to that frame... But sadly enough nothing happens, while another textbutton on which I used asfunction:Play does work...

Can anyone give me the solution or explain this to me in noobienoobielanguage cause untill now people tend to explain it in a to high lvl for me (and that happens sooner then I like to admit)... So I would really apreciate it when someone would planly write the answer in what I have to type like.-----> asfunction:blabla(16) for instance....

Using ASFUNCTION
I'm trying to use the ASFUNCTION command... I copy/pasted the help example in Flash, just place a textfield.. make sure the html is on
and it works fine...

code:
function MyFunc(arg){
trace ("You clicked me! Argument was "+arg);
}
myTextField.htmlText ="<A HREF="asfunction:MyFunc,Foo ">Click Me!</A>";
myTextField.html = true;


The thing is that I will be creating textfields on the fly... and when I do this, the ASFUNCTION doesn't work... here is my code:

txt_data is a blank movie clip to hold the textfields
I also have the sample fla up on the net

go to:
http://www.djcoro.com/ebox/test/test.swf


code:

// SongName Text Format ///////////////////////////////////////////////////
mySongNameFormat = new TextFormat();
mySongNameFormat.color = 0x000000;
mySongNameFormat.font = "Century Gothic"
mySongNameFormat.size = 10;
mySongNameFormat.bold = true;
mySongNameFormat.italic = false;

ntracknum = 1;
ndepth = 0;
nYPosition = 0;
nXPosition = 10;

for (var i = 0; i<listLength.length; i++) {

txt_data.createTextField("my_songname"+i, depth, nXPosition, nYPosition, 0, 0);
eval("txt_data.my_songname" + i).autoSize = "center";
eval("txt_data.my_songname" + i).html = true;

eval("txt_data.my_songname" + i).htmlText = "<A HREF="asfunction:MyFunc,Foo">"+songName[i]+"</A>";

eval("txt_data.my_songname" + i).setTextFormat(mySongNameFormat);
eval("txt_data.my_songname" + i).embedFonts = true;

}



I'm thinking it has something to do with creating text realtime... any suggestions? ;-[

Fania

Asfunction
Hi,

Can I load in a new window an html page if I insert in a text file - to be imported - the following:

<a href="asfunction:getUrl(´page.html','_blank')">OPE N</a>

It's not working...the index page becomes blank.

Kind regards,

Rigel_kent

Asfunction
Hi, i am doing a asfunction for a dynamic textbox. i created alot of functions and wonder if i can make it into 1 function with a parameter

Code:
function load_cot1()
{
loadMovieNum("galore_cot1", 1);
}
function load_cot2()
{
loadMovieNum("galore_cot2", 1);
}
function load_cot3()
{
loadMovieNum("galore_cot3", 1);
}
function load_cot4()
{
loadMovieNum("galore_cot4", 1);
}
function load_cot5()
{
loadMovieNum("galore_cot5", 1);
}
function load_cot6()
{
loadMovieNum("galore_cot6", 1);
}
function load_cot7()
{
loadMovieNum("galore_cot7", 1);
}
function load_cot8()
{
loadMovieNum("galore_cot8", 1);
}


mayb something like

function loadGalore(filename:String)
{
loadMovienum("filename",1)
}

but i nt sure what is the correct scripting

Help With Asfunction
Okay, I'm creating a web site for a restaurant. On the menu, there's going to be a small image of a camera next to the name of each menu item. When the user clicks on the camera, a function is called which shows a photo of the menu item. I need to use asfunction because the menu items are loaded into a text box from an xml document. Here's the code I'm using, and it works just fine:

<a href='asfunction:showItem," + item.nodeValue + ".jpg'><img src='../menu/camera.gif'></a>

The only problem is that I'm settling here. I don't want the user to have to click on the camera. I would prefer for the function to be called when the user puts the mouse over the camera. So, in other words:

Is there any way to make asfunction react to onMouseOver?

I would really appreciate it if anyone could help me out here.

Help With Asfunction
I'm creating a dynamic text field to load a PHP file ... I want to have links in the PHP that create an ASFUNCTION. Right now I have to click the link a couple times in order for it to work.. does anyone know why this is?

Flash:
function MyFunc(jams){
okay =jams;
}

PHP:
a href="asfunction:MyFunc,001"I'm Cameron, I'm Cameron, I'm Cameron, I'm Cameron, /a

http://www.danamediagroup.com/q/test.html

It does weird things when you click on the links as well -- If anyone knows how to fix this.. it'd be much appreciated.

Thanks!

Cameron

Asfunction Help
Can someone explain why this is not working?

Using TextArea with html enabled, external style sheet used to make link style.
In flash as layer, frame 1:

function click(framenum){
gotoAndStop(framenum);
}

In external text file:
<a href='asfunction:click,10'>link text here</a>

Nothing happens when link clicked on....help?? Thanks!

ASfunction
Hi

Thanks for this, I'll give it a go!

Asfunction Help
I am using asfunction to call a function from a dynamic text field. I want to send variable that have been declared, but it sends the text instead of the value of the variable. Can anyone explain how to just send the value and not the text. Here is an example:

var floor:String;
var x_cord:String;
var y_cord:String;
var pic:String;

Details = function(param:String){
var emplocate = param.split(",");
_root.map.gotoAndStop(emplocate[0]);
_root.locator._x = (emplocate[1]);
_root.locator._y = (emplocate[2]);
_root.picture.contentPath = (emplocate[3]);
}

//asfunction call
floor = nodes[i].childNodes[8].firstChild.nodeValue;
x_cord = nodes[i].childNodes[11].firstChild.nodeValue;
y_cord = nodes[i].childNodes[12].firstChild.nodeValue;
pic = nodes[i].childNodes[10].firstChild.nodeValue;

entry += '<br><a href="asfunction:Details,floor,x_cord,y_cord,pic"> View details</a>';


A trace in the function spits out "floor x_cord Y_cord pic" instead of the values of those variables.

I've been stuck for a while

Asfunction
Could someone please help me out with this?

i have an html text field containing a list of items, each with an anchor tag like this:

ActionScript Code:
<a href="asfunction:linkTo,page">
where "page" is a url to an html document that the fuction "linkTo" opens in another dynamic text field.

here's my code:

ActionScript Code:
var loadHtml:LoadVars = new LoadVars();
loadHtml.onData = function(html:String):Void  {
    myText.html = true;
    myText.htmlText = unescape(html);
};
loadHtml.load("test1.html");
//
function linkTo(page:String):Void {
    trace("clicked");
    loadHtml.onData = function(html:String):Void  {
        yourText.html = true;
        yourText.htmlText = unescape(html);
    };
    var newPage:String = page +".html";
    loadHtml.load(newPage);
}
This works fine, BUT if i nest the two text boxes in a containing movieClip, "myText" is properly loaded with the html page, but none of the asfunctions work....
Can anyone see where I'm going wrong with this one?
Thank you

AsFunction: In Xml
asFunction: in xml is now replaced with event:

here is my xml....
<text>
<![CDATA[<p>Information used to <font color="#0000FF"/><u><a href="event:_root.doSubstep1"/>develop</a></u> this lesson can be found in the following document(s):<font color="#0000FF"/><u><a href="event:_root.doSubstep2"/>HotWord1</a></u><</p>]]>
</text>

<hotWord>This is a hot word, name and definition 1.</hotWord>
<hotWord2>This is a hot word, name and definition 1a.</hotWord2>

doSubstep1 and 2 are my functions in my action script code. This part of the xml populates one text box in my .fla.

Here is the code that handles this....

ActionScript Code:
maintxt_txt.addEventListener(TextEvent.LINK, doSubstep1);

maintxt_txt.addEventListener(TextEvent.LINK, doSubstep2);
   
function doSubstep1(linkEvent:TextEvent):void
{
        hotWords.hotWord_txt.htmlText = "" + SBList3[SBNum].parent().hotWord;
}

function doSubstep2(linkEvent:TextEvent):void
{
        hotWords.hotWord_txt.htmlText = "" + SBList3[SBNum].parent().hotWord2;
}

develop and HotWord1 show up underlined in my text box. But I when you click on develop, i need it to call the doSubstep1 function, and when I click on HotWord1 I need it to call the doSubstep2 function. As the code is right now, they both call doSubstep2. Is there any way to find out which word the user is clickiing on in my text box? Or a different way to do this at all? Any help would be great!!!!

Asfunction Help
I just started to learn how to use the asfunction last week, and am curious as to how I would do this. I would like to have my dynamic text when clicked open up a swf using the asfucntion(I got that figured out) but I also want the same hyperlink to jump to frame 5 in the current movie (Industry Communications). How would I do this? Here is the action script I have so far:

function loadSWF (swfname){
loader.loadMovie (swfname);
}

Here is the text that I have in my .txt file:
<a href="asfunction:loadSWF,IndustryCommunications_Co mpanies.swf">

I have a blank MC labeled "loader" that loads the swf which is working great. How would I enter a second argument to go to frame 5 of my current swf named Industry Communications as well?

'asfunction' Help, Please.
I am loading an external .swf file into my flash movie with the following code:

<a href='asfunction:container.loadMovie,assets/cool.swf'>

The movie loads fine into my container area, however I need it to be working by using my right / left arrow keys to browse through frames in my external .swf. This browsing function is for some reason disabled when it loads. The external .swf works fine when loaded by itself.

How can I get the right / left arrow key browsing to work in my external .swf after it loads into my flash movie?

Thanks to whomever can help. You'll be a hero.

Asfunction
Hi,

Can I load in a new window an html page if I insert in a text file - to be imported - the following:

<a href="asfunction:getUrl(´page.html','_blank')">OPE N</a>

It's not working...the index page becomes blank.

Kind regards,

Kepler

Asfunction Help
Hello, I've done a search and haven't found a solution to my problem.

I have an embedded SWF in an HTML file.

In my HTML, I want to navigate the SWF from text links, "go to frame 2" to advance the SWF etc. Everything I've seen seems to be how to perform this task from within Flash using dynamic text.

In Flash I have given frame 2 the frame name "green"

In Dreamweaver, I'm using the code
<a href="asfunction:gotoAndPlay,green">green</a>

But when I open the HTML I get "Firefox doesn't know how to open this application...(asfunction) isn't associated with any program".

I know I'm doing something wrong, but can't figure out what. Can this function only be done using Java? I see the control shockwave behavior works very poorly on different browsers.

Thanks for any help!





























Edited: 05/07/2007 at 10:59:27 AM by zagods

Asfunction
when i use asfunction it works only when i link to a frame above a certain number. for example: i want to asfunction from frame one to frame three or six or eight - and nothing happens. but if i asfunction to frame ten or above it works. what could be the cause of this? thanks!

Asfunction
I need to pass 2 parameters to by using asfunction. How can i do?

Asfunction Help
Ok, I'm trying to figure out how to use "asfunction" a little differently than I have in the past. Unfortunately, I'm not even sure if this is the way I should be going about this.

Basically, here's what I want to do. I want to embed a .swf into an HTML page, and by utilizing a hypertext link on the HTML page, pass a function into the embedded SWF. Essentially, I'd just like to change the frame of a MC within the flash movie using a link in the HTML footer of the page. It's important to note that the HTML is not being loaded via text file into the flash movie.

Obviously just attaching a <a href="asfunction:_root.targetMC.gotoAndStop,1"> before the text isn't going to work, as the browser won't know what to do with this code. Is there some sort of plug-in I'd have to attach, or is there a different method of coding that'll work in this case?

Hopefully someone here will understand how to fix my problem.

Asfunction
I'm using asfunctionf or the first time. It seems that the function is called in the scope of the movieclip parent of the textfield which contains the link. Right?

So if I have a class that contains a movieclip that contains the textfield, how to do I specify that the asfunction should call a method of the class?

Asfunction Help
Hi all

I am developing a small flash site and as always, you get to the end and the customer wants to change something!

Anyway, here is my dilemma that I need advice on. At the moment I have small movieclip buttons in my projects.fla file each with an instance name 1 to 10. When clicked, these buttons load another external movie clip file and an animated sidebar movie based on the instance name of the button that is pressed.

Now, in the sidebar movie clip that is loaded, I load a text file which has text content associated to the externally loaded movie and the text needs to include hyperlinks which when clicked load the same external movies in exactly the same way as the buttons do on my projects.fla file.

Could someone provide a snippet of code which basically runs the code (attached) that is executed from my small movieclip buttons and show me how it will work being called from the asfunction in my text file? Is it possible?

I hope that makes sense and thanks for reading.

Here is the code I have inside my small movieclip buttons.









Attach Code

this.onRelease = function() {
_parent.subNavPress(_name);
picTransition();
_global.kbc = _name;

// activate the sidebar (if required)
_root.sidebar_mc.gotoAndPlay("halfway");

//time delay - allows picTransition time to reach 100%
setTimeout(function () {
_parent.mc_screen.loadMovie("proj_"+_name+".swf");
}, 400);
};

Asfunction Help
I'm having a hard time workin on this one.... I've got some code:


Code:
//this establishes the function hyperlink
multicam_fold.blue_txt.intro_blue_txt.htmlText = ("<a href='asfunction:_root.container_1.var_swap,EF1'>EF-1</a>");

//this is the variable
var_swap = function(output){
tester = ""+output+"";
intro_popup.gotoAndPlay(out);
}
EDIT: I'm a retard.

intro_popup.gotoAndPlay(out);

---->

intro_popup.gotoAndPlay("out");

two hours of mayhem for TWO FREAKING QUOTES. ARG

Asfunction
Hi Everyone

Does anyone know if it possible to assign a rollOver event for an asfunction?

Thanks in advance

Asfunction In Xml
Hi all,

I'm trying to call an function in flash from xml. so I used <a> tag and asfunction. But how come when it calls a built-in function in flash, it works. and when it calls a custom function, it just won't work???


function customFunc(a){
trace("here")
}

these are in my xml file:
<a href="asfunction:trace,here">Click</a>
-- okay this one works
<a href="asfunction:customFunc,whatever">Click</a>
-- this one doesn't


Thanks in advance

Asfunction
Sometimes I just can't realize my ideas with flash... :-(

I am loading html formatted data in the dynamic text field using load vars.
In this html data i put some hyperlinks with asfunctions.

HTML LINK:

<a href ="asfunction:myFunction">link<a>

CODE:

function myFunction():void{
myLV.load("data_1.html");
}

I am using this asfunctions to load another html formatted data in the same text field.
That is no problem.
But when I wrote 10 hardcoded functions I realize that there should be a nicer way to do this because I don't want to mess with my flash files everytime I put in another link (for example when I am updating my site).

I just want my site to be more dynamic, when it comes to updating.
I guess I have to write some code which is capable to do this via external file (XML or PHP) .

Can someone give me a direction please.

THANK YOU IN ADVANCE

Asfunction Help Please
Im not sure this is even doable, but based on my limited knowledge I dont see why it isnt working. I am having asfunction passing a simple arg, a string, to a function. In that function I am trying to compare the arg to another var, to see if they are identical strings. It wont work.. not real sure why, I am guessing a weakness in asfunction I am unaware of, or just a general weakness on my ability. I thought maybe eq instead of == but nothing. Anyone that can shed some light on this, or another way to accomplish this would be great, thanks.


Code:
var cat:String = "CLICK ME";
var rat:String = "test";
var dog:String = "test";
test_tf.htmlText += '<A HREF='asfunction:Test_Func,'+rat+' '>'+cat+'</a>';
function Test_Func(arg:String) {
trace(arg);
trace(dog);
if (dog == arg) {
trace("success");
}
}

Asfunction
Hi Everyone

Does anyone know if it possible to assign a rollOver event for an asfunction?

Thanks in advance

Asfunction: Is This Possible?
I'm using the follwoing asfunction to send the flash player to frame 5 of my movie and it works fine:


Code:
function goto () { clickme = gotoAndStop(5); }
what I need to know is is it possible to change the frame the player goes to from the . txt that I'm using. This is because my client needs to be able to target different parts of the flash move when they update the text file.

Is there anyway this can be done??

Asfunction And XML
Background knowledge

I use an XML file to populate news dates and headings (works)
Each article is clickable and goes to a function sending it a variable (works)

The variable I send is the nid within my XML file (The variable is sent correctly when I test it so I know the fucntoin is recieving the variable)

Here is my XML file

Code:

<dates>

<news>
<nid>1</nid>
<ndate>06/06/06</ndate>
<ntitle>Article One</ntitle>
<ncontent>This will be the content for news article 1</ncontent>
</news>

<news>
<nid>2</nid>
<ndate>05/06/06</ndate>
<ntitle>Article Three</ntitle>
<ncontent>This will be the content for news article 2</ncontent>
</news>

<news>
<nid>3</nid>
<ndate>04/06/06</ndate>
<ntitle>Article Three</ntitle>
<ncontent>This will be the content for news article 3</ncontent>
</news>

</dates>






Ok so here is my first question on the asfunction

I am using an asfunction and passing it nid.

eg:

<a href='asfunction:MyFunc,"+nid+"'> here</a>

Now it passes correctly but I want to know what it passes as ie a string, int etc.

The next Question is on XML

Once in my function i want to go thru my xml file again and retrieve the data that matches that nid.

How do I do it?

If I am not clear on an area pls let me know

Thanks in advance

jmcall

---asfunction & Netscape---
I've been using "asfunction" to call functions from text in a dynamically loaded xml document. However, it seems that there is a problem with the "asfunction" working in Netscape (i'm using 4.72). For example, if I try to load a movie like this:

function loadClip(url) {
loadMovie (url, "_level2");
}

and try to call that function from a text link like this:

<a href="asfunction: loadClip, myMovie.swf">Click here.</a>

it works fine in IE, but in Netscape, the movie does not load at all.

I know it's not a problem with the function call because I created a dynamic text field to display the "url" parameter and it displays fine.

I thought it was a problem with the fact that the parameter is not a string. But when I added quotes to it, or tried the String() function, it still didn't work.

Any help would be greatly appreciated.

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