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




Shared Buttons



Hi,I have created a shared library for one of my project.its running wellBut the only thing is I am not able to add buttons from this shared library. Can someone help me on this issue? How can I share buttons?May be I am doing it in a wrong way.Plz help



KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 12-20-2006, 02:00 AM


View Complete Forum Thread with Replies

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

Shared Buttons
I am trying to use a shared library to house buttons which provide the main navigation through my site. right now I've got a movie clip loader which works, and i am trying to make it so that when a user clicks on one of the buttons it loads the appropriate movie clip.

Here is my AS for the button:

myMCL.loadClip("av.swf", 5);

and this is the error I am getting:

-----------------

**Error** Scene=Scene 1, layer=a, frame=1:Line 1: Statement must appear within on handler
myMCL.loadClip("av.swf", 5);

Total ActionScript Errors: 1 Reported Errors: 1
-----------

I'm afraid I just don't understand what this means.

Shared Buttons With Actionscript
i am using a shared library which works, only the buttons's (that are shared) actionscript dont seem to be there when playing the file.

they wont even work in there own library - they used work fine in all the imported movies.

any ideas

Different GetURL Paths For Shared Library Buttons
Hi All,

can a button from a shared library have a different getURL path..? Currently, a button in my shared library has a particular path and all the versions of this button in other files map to the same location, although I was able to right click/action/double click getURL and give them different paths. Thanx.

Button Script For Buttons In Shared Library Don't Work
Hi
Followed procedure for creating buttons in a shared library, these buttons placed in new flash movie. Simple "on(release)" script does not work!!

I see a few other peops have noted problem is there something fundamentally wrong that I should know???

Thanks in advance

Could A MovieClip Be Stored And Shared In A Remote Shared Object?
Let's say there are two clients connected via FMS,
and have a remote shared object SO.

When one client has a movieclip mc and sets,

SO.data["movie"] = mc;

is it possible for the other client to render
the content of mc, after SO synchronization,
by simply doing:

mc = SO.data["movie"]:

???

Do Symbols Inside Shared Movie Clips Get Shared?
I have my main fla file that loads shared asset movie clips (at design time) from another fla. Inside each of these movie clips are various images and other media.

when i share a movie clip and import it into my main fla file does the symbols inside the shared movie clip get shared along with the movie clip or are they kept in the main swf file when i export it.

I have export for runtime sharing on the movie clip but not on the symbols inside the movie clip so will these symbols get copied and exported in the main swf file rather than act as a shared asset in my other .fla/swf file?

If so will i need to enable export for runtime sharing on every symbol inside my shared movie clip?

Secondly when sharing images that are converted to symbols do i need to enable export for runtime sharing on just the image symbol or on the source image file as well for the image to be shared rather than copied over to my main fla/swf file?

Thanks in advance

Probelm Using Shared Sounds From A Shared Library
if i test my library (by itself without loading it into the container) my linked sound objects play fine but when i try to access them after the library has been loaded into lets say _root.sounds movieclip, nothing works.

Shared Objects. How To Undo Shared Object
Hi guys,

Basicaly I created a simple login function by following the shared objects tutorial (http://www.kirupa.com/developer/mx/sharedobjects.htm).

I wanted a button placed on my wlecome screen allowing the user to go back to the creating screen of the shared objects.

So basically another shared object can be made.


Any Ideas?

Shared Font & Shared Library
I have just started using shared libraries...

It all seems to working well - BUT it is doing something strange with a font I embedded in the sharedLib.swf

The font is successfully embedded into the library of the sharedLib.swf and is linked correctly to and from the sharedLib.swf.

HOWEVER - it does not seem to be exporting properly into the main movie - what I mean is that it does not appear in the child movie clips and buttons in the main movie, unless I put a blank textfield using the same shared embedded font on the _root timeline at the start of the movie?!?!

This seems bery quirky and I am not 100% confident with it and any potential load issues that may occur.

Has anyone had any similar experience or advice on this matter plz?

Shared Assets Inside Shared Assets?
I have a rather large flash app I am building for the web and I want to minimize loading times for different sections of the system by using shared assets. However I was wondering if you could have a 2 or even 3 layer shared asset system.

I'll try to explain what I mean using the problem that I am having.

firstly the files>

main.swf //the main movie in which all other assets or clips are used in
section1.swf // shared asset file holding movieclips
section2.swf // shared asset file holding movieclips
section3.swf // shared asset file holding movieclips
interface.swf // shared asset file holding the interface images (large file!)

When the system is running main.swf will get the assets for the different sections from the section.swf files. However each section.swf file uses the same interface images so another shared asset file interface.swf holds these images and it is shared between the 3 section.swfs. However these too are shared asset files that provide assets for main.swf

In this system I have two layers of shared assets because only main.swf is what the user uses.

here is a simple layout>

main.swf
|
|----------------|--------------------|
section1.swf section2.swf section3.swf
| | |
---------------------------------------
|
interface.swf


So will I actually save loading times by loading only one copy of interface.swf when one of the section.swfs loads? After that any other section.swfs that have their assets used in main.swf will get their interface images from the cache since interface.swf has alreadey been loaded when the first section.swf loaded.

Would this 2 layered shared asset system work or can you only have one layer shared assets like normal?>


displayed1.swf displayed2.swf displayed3.swf | | |
|----------------|--------------------|
|
assets.swf

any help welcome

Thanks

(EDIT: hrm the layouts I did display differently than they did in author mode)

Shared MCs
I am sharing a few MCs that make up a preloader, but can't seem get my SWFs to recoginze them.

Each MC has a unique identifier and is published to the URL:

/flash/shared.swf

I did a test movie (test.swf) which is in an html file located at

/about/test.html

I link each shared MC in test.swf to:

/flash/shared.swf

with the appropriate IDs for each.

I then added the base attribute/param, to my html file:

base="http://myTestingIP/flash"

why are my assets not gettig shared?

Shared Obj
Hey, just trying to get my head around Shared Objs...

code:
// Frame 1
_so_Usercheck = SharedObject.getLocal("Checker");


//Frame 2
_root.stop();
if (_root.alreadyplayed==_so_Usercheck.data.Userhelp) {
//skip intro
gotoAndStop(3);
} else {
//play intro
gotoAndStop(4);
}

//Frame4
stop();
_so_Usercheck.data.Userhelp = _root.alreadyplayed;
_so_Usercheck.flush();


Hmm...I really have buggered this up lol

Basically, I just wanted it to check and set a sharedObj to see if something in the swf has played or not, and if it hasn't, to set a obj to not play it again when the user re-visits but if it has, to bypass and go to a certain action

Shared Obj
Hey, just trying to get my head around Shared Objs...


ActionScript Code:
// Frame 1_so_Usercheck = SharedObject.getLocal("Checker");//Frame 2_root.stop();if (_root.alreadyplayed==_so_Usercheck.data.Userhelp) {    //skip intro    gotoAndStop(3);} else {    //play intro    gotoAndStop(4);}//Frame4stop();_so_Usercheck.data.Userhelp = _root.alreadyplayed;_so_Usercheck.flush();


Hmm...I really have buggered this up lol

Basically, I just wanted it to check and set a sharedObj to see if something in the swf has played or not, and if it hasn't, to set a obj to not play it again when the user re-visits but if it has, to bypass and go to a certain action

Linkage To A Shared Lib - HELP
This is the second time I am posing this question,
but hopefully I will get what I am looking for:

It goes like this:
I have a main movie which is blank in frame 1 except for a preloader. The main movie starts on Frame 2.

However, there is a mc in the frame 2 which is (implicity) linked to a shared library. So this mc gets its movieclip from the shared lib.

What I want to know is that while I am in frame 1 (in the preloader for the main movie itself), how can I determine when this host mc has indeed loaded the mc from the shared library. getBytesLoaded() is only for the main movie - it does not account for any links to shared libraries.

If you have done something like this I would like to know.
PLS HELP!

Shared Libraries
i heard that you can link an mp3 or wav file to use in your flash movie from a shared library that would be outside your movie. So the loading time will be cut down.

Maybe i don't understand the shared library concept but my problem is i have to use an mp3 for background sound and if i load it in directly my movie will be too big.

any ideas on how to solve this?

thanks for you help in advance...

Shared Library
I made a shared library.swf with 20 images and i want the images shown in the main movie (with the laodMovie action in a placeHolder) On click in the main movie, the next Image must be shown, on click the next one, etc. So how can i control the images in the shared library.swf
thanx for your answer
kind regards
lexder

Shared Libraries
Can anyone give me some insight into shared libraries and how they work. Right now I have a window "class" that I drag from swf to swf to use. If I open up a shared library will that in effect keep classes from being duplicated?

Shared Libraries
hi

i'm looking to better understand shared libraries. my impression is that utilizing them offers the potential to save loads of time when dealing with, for example, a presentation that contains similarly structered but different (in the details) swfs...

i'm even just looking to be pointed in the direction of a good explanation.

thanks

Shared Libraries
OK here goes...

I have 2 movies, A and B. A is the main movie. B has nothing on the stage, just some objects in its library which I want to dynamically load onto movie A's stage. Movie A is on level 2 and Movie B is on level 1.

What is the syntax for loading an object from movie B's library onto Movie A's stage? I suppose attachMovieClip comes in somewhere, but what are the arguments and the prefix?

cheers,

Darkwhiteorange

Shared Object
Hi,
Has anyone used the Shared Object in Falsh MX. I tried it but nothing seems to be saved when I restart the movie. Shared Object should store information on the users local computer like a cookie. I'm using it to store text entries in an address book application, but when I go back to the app all my entries are gone. Is there any way to see if the Shared Oblect is working fine?

Shared Object
Could some one please tell me where a good tutorial is for shared objects i want to be able to specify the location not use a cookie! or just send me the script.

Many Thanks
Michael

$ Will Pay For Shared Object Help $
I've created a standalone quiz that tallies and scores performance. I need to create a shared object element that tracks the users scores in a list box. So I can review the perfmance data. This quiz will go on a laptop and will taken between 100 and 300 times I suspect. The quiz can be viewed <a href="http://38.181.236.4/~chimes/quiz/quiz.html" >here</a> and I created a page where the list box would reside, which can be reached by pressing a hidden button in the top right corner of the quiz frame.

I'm on a 48 hour deadline and have other things to work on, and will try to complete it on my own, but would pay for help at this point, as I'm not familiar with .so stuff yet. If you're interested: chimes@subsystem.com

Thanks

Shared Libary
i need to use a shared libary - but i am a little confused about the URL when exporting for runtime - flash 5 doesnt need it. i guess i want to put a relitive path in it somewhere.

are there any examples .fla's around??

thanks

Shared Library
Dear Friends,
I am calling a sysmbol to the main flash file from the a shared library. Apart from the this sysmbols there are other symbols. I am also using XML for maintaining database of my file. I have two layers . One for symbols and other for action. I am displaying the shared symbol in the 4th frame after the XML being loaded. My file is used on WEB. I have faced a problem while testing my file in an NT server.

The shared symbole is not getting displayed for the first time. If I refresh the browser then I shared symbol is getting displayed.
Please help me why such problem is coming.
Thanks
Rashmi

Shared Objects
Hi there,

Question:

Is it possible to use SharedObjects to examine, if a user is online?

If so, I maybe could use this function.

Please help!

Manuel

Shared Libraries
Hi,

I have set up a common shared library that will
hold things like my icons, and other movie clips that
I may decide to change at a later date.

It seems to work ok for the movie clips, but not for variables stored inside the movie clip.

In my test movie that loads the shared library, all the
movie clips come in fine. I placed a piece of dynamic text
and set it to _root.myclip.myvar and it correctly displayed the string set by that variable.

However when I try something like
trace("var = " + _root.myclip.myvar);
It doesn't display anything. I need to be able to swap in libraries with different values for that variable.

So the question is, how come the dynamic text pick up the variable, but the action script doesn't?

Cheers

Shared Fonts
Hey
i have a doubt about the shared fonts method!!!!
If i load a text file in a flash movie and the user does not have my specified font it will default to some other font right!!!!!
but if create a shared font and load the font from there will this solve it???
thanks in advance

Has Anybody Used The Shared Object?
Has anybody out there used the shared object yet?

We are using XML to track every activity carried out by the user in our movies and storing that in a database, but it all comes to nothing if the user refreshes the movie before we track!

I was thinking of creating the tracking XML inside the shared object so that it cannot get wiped and [potentially] the user could restart from the same place the next time they use the movie.

Anyone any thoughts on this? Anyone done anything similar and come across any problems?

Much appreciated,

Gaius
[BTW, what is that cow icon there for?]

Shared Objects
I've seen many tutorials on how to store text field info in "shared objects" and I was wondering if anyone knows if you can store other things in "shared objects?"

What I'm specifically looking to do is have the user select the background colour of the movie using the setRGB and then have this info stored in a shared object so when the user returns, the background will stay the same colour that they selected on their previous visit.

Any possible solutions would be greatly appreciated!

Shared Objects
I've seen many tutorials on how to store text field info in "shared objects" and I was wondering if anyone knows if you can store other things in "shared objects?"

What I'm specifically looking to do is have the user select the background colour of the movie using the setRGB and then have this info stored in a shared object so when the user returns, the background will stay the same colour that they selected on their previous visit.

Any possible solutions would be greatly appreciated!

Using Shared Library?
I am curious about how to implement a shared library. When a library object is needed, is the shared library called upon? Does the whole shared library have to load in for one object? Or do you have to initially load the shared library in using loadMovie so it can be used?
any help appreciated.

MX Shared Object
Hi guys,

I'm looking at the new feature in MX, shared Objects..
previously I had been using fscommand"save" in an .exe mov.
so now I've converted to MX I gota change it to SObjects!
and I would like to know if anyone knows if I can assign a path to write the file..! .sol file! if you could help me with the syntax I would be very grateful.!

Nate!

Shared.object Or Something...
Hi I hope someone can help with this first step I am taking with the shared.object or something like that...

If I had a mc that could be dragged...

How could I enable the next time the flash movie is opened or accessed for the mc to still be in the position in which it was left.

There are no server technologies involved.

Thanx in advance

Shared Object
i posted this yesterday, and i am more confused about it today.

I have a drawing program. I want to save the drawings as their own swf files. in the simplest explination possible, how can i assign a button to save the drawing.

Shared Objects
I am trying to assign the 'scheme' variable to 'grey' using a shared object.

This code loads on the first frame

mySO = SharedObject.getLocal("colors");
scheme = mySO.data.scheme;


and this should give the 'scheme' variable a value of 'grey'

on (release) {
mySO.data.scheme = grey;
}

I don't think it is, because if I look at the .sol file no value is set to 'scheme'
¿ #TCSO  colors scheme

Any idea why?

Seeing Shared Objects On My Box
First:
Does anyone know where I can find my shared objects on my PC. I'm running windows 2000?

Second:
Does anyone know how I can retrieve the local path of a shared object in my code. By default the shared object is supposed to be stored under the "full path". I would like need to see what the full path is to troubleshoot a problem I'm having.

John

Shared Objects
I've searched the board on shared objects and found a lot of reference to the Macromedia site. Most all of the reference refers to using the shared object as a cookie to keep a name.

I want to use it so that it sees if they alread visited and if so it goes to the end of the .swf file.

I've found the code below but I can not seem to make it work. Has anyone successfully completed what I'm tring to do and if so could you help me out

------------------------

// setting up the shared object.
var mySO = SharedObject.getLocal("cookie");

// if we have something in stored we skip the animation.
if(mySO.data.stored)
{
// Frame is = the first frame after the anim.
gotoAndPlay(216)
} else
{
// if stored weren't found we store true
// in it to mark that the user has been here.
mySO.data.stored = true;
}

Shared Objects
Hi. I am currently building an MP3 player using Flash MX and ice Projector. The functionality of the playlist is based around a set of arrays. There is one array, called Artists, and another called Tracks, and a third called Files. Artists stores the artist names, Tracks stores the title, and files stores the streaming location. Each individual track is identified by it's loaction in the array. I am almost done except for the playlist. The problem I am running into is that I can't get it to save the arrays to Shared Objects.
I have the following function to display the array values in the playlist: (This works)

Code:
function loadList(Tracks,Artists) {
PlayList.removeAll();
for (i in Tracks) {
Song = Artists[i]+" -- "+Tracks[i];
PlayList.addItem(Song,i);
}
PlayList.sortItemsBy("data",asc);
}
Then I have this function to save the playlist, which is called when the user clicks the save button: (This doesn't work...)

Code:
function MasterSave(Tracks,Artists,Files) {
PL = SharedObject.getLocal("Cialnet_Playlist");
for (i in Tracks) {
PL.data.Tracks[i] = Tracks[i];
PL.data.Artists[i] = Artists[i];
PL.data.Files[i] = Files[i];
trace(PL.data.Tracks[0]);
}
PL.flush;
}
When the MP3 player is first evoked, the following function is run:

Code:
function LoadPL(){
PL = SharedObject.getLocal("Cialnet_Playlist");
if (PL.data.Tracks==undefined) {
trace("No Playlist");
}
Tracks = new Array();
Lengths = new Array();
Artists = new Array();
Files = new Array();
curTrack = 0;
pos = 0;
playing = "False";
// Defines track names shown in playlist and playing window
for (i in PL.data.Tracks) {
Tracks[i] = PL.data.Tracks[i];
Artists[i] = PL.data.Artists[i];
Files[i] = PL.data.Files[i];
}
_level0.LoadList(Tracks,Artists);
}
And obviously, the load function doesn't work either because the save function doesn't write anything to the SO...

Is there anything I have overlooked? From what I have heard, it is possible to save arrays into SOs, but this method isn't working. Much thanks for any help.

--Andrew
---Trmbne2000@hotmail.com

Shared Library
anyone know if a symbol has to load again if it has already been loaded in another .swf file
Is this where I would use a shared library?

Shared Libraries
I am trying to use a shared library that holds navigation buttons, and it's acting a little strange... I made the buttons in a separate .fla file, and set them all to export for runtime sharing, and then published that movie, and then i dragged each one into a test movie, and it automatically set them to "import for runtime sharing," but when i publish the movie, the actions on the buttons aren't executed, but the look right, and the over and hit states work fine... any ideas?

dave

Shared Objects
Is there any way that I can save the .sol file along with my swf

Regards
Dabz

================================================== ====================
"Life is a mirror, what you do is reflected back to you, Be nice to
everyone"
================================================== ====================

HELP With Shared Objects
is it possible to record the top 10 highest scores sorted i order by using shared objects?? if so, then how is it done?

i badly need to know how to make a high score record for a game that is intended to be played on a standalone computer and NOT on the internet...

Please please help me....

thanks!!!

HELP W/ Shared Objects
is it possible to record the top 10 highest scores sorted in order by using shared objects?? if so, then how is it done?

i badly need to know how to make a high score record for a game that is intended to be played on a standalone computer and NOT on the internet...

Please please help me....

thanks!!!

Can I Do This With Shared Objects ?
ok i am trying to get the hang of this command and so far i got it to work. But now i want to go to the next step but dunno if thats possible and how.

I'm trying to make some sort of database in flash. what i was wondering is if it is possible that i can use a add another person option... so i can add new persons at any time and then when i alter the info and numbers of the person it will save it and i can see/edit those numbers again when i choose the person from a list ?!?

can i save all these persons in just one file ? or do i need to create multiple files, and if so how can i let it auto make a new file with info with persons name ?!?!

I hope i explained myself good enough
thanx in advange

assenoost

Shared Components
Hello,

I'm trying to shared components across 2 files. 1, the base movie, has a scroll bar coloured purple. The scroll bars compontents linkage property is set, as; Export for actionscript, Export for runtime sharing, and Export in first frame. The URL field has nga.swf, the name of the movie itself.

The second movie, also has a scrollbar in it, but I'd like it to take on the properties of the base movie scrollbar, once it's loaded into that movie. I've set the linkage properties to; Import for runtime sharing, and I've used the nga.swf in the URL field.

O.k., so what's the prob? Well, in my testing environment, everything works well, the 2nd scrollbar take the properties of the first and the content in the dynamic field I'm pointing it to, scrolls.

When I move the files up to their live location, the 2nd scrollbar takes the property of the first, however, the content does not scroll.

Now these are exactly the same files, set up in a mirrored dir structure. The properties of the base scrollbar come, but the scrollbar doesn't scroll, ONLY on the production site.

Another thing that's strange, is that if I don't link the 2nd movies scrollbar, the content becomes scrollable on production.

I'm not sure what's going on. I've tried using the full, URL path on the production side in both movies with no different results.

If anyone could shine some light on this problem, I'd be grateful.

- J

Shared Object
what is shared object?
How can i use single shared objects for two or more different swfs.

Shared Objects
How can we use Shared Objects (Flash Cookies) created by one swf file but called by another one. Please help.

Var Name In Shared Object
Hi, I'm using MX.

I constantly have this problem:

The thing I need to refer to has a variable in it.

I want to save the items of an list so that it goes like sharedobject.data.item1.name = whatever, sharedobject.data.item2.name=another name.... saving all of the items in a list.

I read another thread in FlashKit where another user had the same problem and was answered: use something like _root[mcname]._x = #. This is my code so far:



for (i=0;i<=_parent.imagelist;i++)

{

so.data["pic"+i].name = _parent.imagelist.getItemAt([i].label)

trace(so.data["pic"+i].name)

}



I've also tried doing a simpler version of the above:



for (i=0;i<=5;i++)

{

so.data["pic"+i] = i

trace(so.data["pic"+i])

}

, but it keeps saying "undefined."

I'd appreciate any help, thanx.

Shared Objects Help
Hi,

I'm trying to set up 'placeholder' of sorts, so that when a user clicks a "set bookmark" button, the _currentframe is recorded in a sharedobject. The next time the movie is run, the movie will automatically gotoAndStop to where the _currentframe was recorded (the frame the user was on when the "set bookmark" button was pressed)

I am attempting to do this with shared objects, rather than cookies.

My first frame is a blank key frame, with actionscript:
-----------------------------------------------------------
//create the local Shared Object
so = SharedObject.getLocal("bookmarker");

//if shared object has data already in it
if( so.data.placeHolder != null )
{
_root.gotoAndPlay( so.data.placeHolder );
}
------------------------------------------------------------

then, in subsequent frames, the user can click a button. This button has actionscript:
------------------------------------------------------------

on(release)
{
so.data.placeHolder = _root._currentframe;
}
------------------------------------------------------------

this method works perfectly when testing a movie, so if i set a bookmark, close the swf, and testmovie again, it will automatically jump to where i set the bookmark

the problem is when I export/publish, neither running the swf nor the html file works in whatever dir i publish to; the sharedobject data isnt remembered so the movie will always start at the beginning rather than the bookmarked frame.

I am guessing it is a problem associated with the path of the shared object and where it is stored. Is there a way to always store it in a user's IE cache?

Thanks for any suggestions

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