473,748 Members | 2,594 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Please help, Shared objects problems, Enlightened individual required

1 New Member
Hi, I'm having trouble with setting up a shared object and I really need some help from someone more enlighten then myself in the field of actionscript :)

Basically I have a talking character that introduces a site and says hello (basically an intro) but I don’t want him to repeat his speech every single time the area gets refreshed or the page gets revisited. On top of that I don’t want the speech to get skipped once and never seen again, I just want to reset the cycle a little later on.

The whole premise has become a little complex for me and I wasn’t really sure what the best way of doing this was, although through my travels I did find some code in a tutorial that implements a time control but I'm not exactly sure how to fix it up to apply to my situation.

This is put in the first frame to control the timing:

var today = new Date();
var so:SharedObject = SharedObject.ge tLocal("time");
var period = 15000;

Then this is put into the instance:

if (loaded == total)
{
if (!((_root.today-_root.so.data.v al)<_root.perio d))
{
_root.so.data.v al = _root.today;
_root.so.flush( );
_root.gotoAndPl ay(2); //full animation
}
else
{
_root.so.data.v al = _root.today;
_root.par = "skip";
_root.gotoAndSt op(162);
}
}

The issue is when I add it to the instance of course I get a:

**Error** Scene=Scene 1, layer=Speech Bubble, frame=1:Line 2: Statement must appear within on/onClipEvent handler
if (loaded == total)

because it hasn't been placed in a frame. Yet the tutorial seems to have no such problem.

I'm not sure if it can be placed in every frame but there’s 165 frames and many animations so an easier way to set up the code would be much appreciated.

I did consider setting up an 'enter page' however because of the nature of the situation and the character talking on every page and not just the main page (for example: he talks again in the ‘Links' page) I was concerned I would need a mechanism I can use throughout the site to prevent the problem as I can’t build an 'enter page' for every single link.

Otherwise I might just be going the complete wrong way about it and If there’s a method out there that makes more sense I would love to do it that way instead :) if you are able to help me thank you so much!
May 9 '07 #1
1 1550
Motoma
3,237 Recognized Expert Specialist
You might be better off setting a COOKIE which expires in a set amount of time, and checking that COOKIE before deciding whether to run the speech or not.
May 9 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
3466
by: abcd | last post by:
kutthaense Secretary Djetvedehald H. Rumsfeld legai predicted eventual vicmadhlary in Iraq mariyu Afghmadhlaistmadhla, kaani jetvedehly after "a ljetvedehg, hard slog," mariyu vede legai pressed Pentagjetvedeh karuvificials madhla reachathe strategy in karkun campaign deshatinst terrorism. "mudivae maretu winning or losing karkun global varti jetvedeh terror?" Mr. Rumsfeld adugued in a recent memormariyuum. vede velli jetvedeh madhla...
11
1606
by: dhnriverside | last post by:
Hi peeps Ok, so I thought I'd have a go at making a console app in VS2k5... I haven't written any windows apps for years, let alone dos apps (been web programming) and I've hit a dumb error... "An object reference is required for the nonstatic field, method or property " This is occuring in my main function...
15
4942
by: Rob Nicholson | last post by:
A consequence of the ASP.NET architecture on IIS has just hit home with a big thud. It's to do with shared variables. Consider a module like this: Public Module Functions Public GlobalName As String ' this is ineffect a global application object End Module
4
5671
by: john | last post by:
I'm having some Interop problems. I really need someone's help on this, i'm running out of ideas. I have upgraded my Data access controls to the latest ver. Now then i have a form with these ref's: Interop.DAO,System,System.Data,System.Drawing,System.windo ws.forms,System.XML. all that's on this form is a button and when the button is clicked it opens up a fox pro database and gets the needed info/close. Now this works just fine on my
3
2440
by: Adriano | last post by:
Hello, when I try to print something, either DataGrid or from Crystal Report viever the folowing error message appears and cancels printing: Object reference not set to an instance of an object :(((( Anyone pls help me to solve this problem!!! thanks in advance,
1
9650
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej and I was wondering if anyone here would be able to give me some tips for young players such as myself, for learning the language. Is this the best Newsgroup for support with JAVA?
32
12511
by: robert d via AccessMonster.com | last post by:
I'm looking at converting DAO to ADO in my app. All of my DAO connections are of the following structure: Dim wsName As DAO.Workspace Dim dbName As DAO.Database Dim rsName As DAO.Recordset Set wsName = DBEngine.Workspaces(0) Set dbName = wsName.OpenDatabase(CurrentProject.FullName) Set rsName = dbName.OpenRecordset("SQL Statement")
1
1135
by: Darkman2008 | last post by:
Hello This is an extension task for my current course where I have to create a Word guessing game. There are 4 classes.(List, game, word and InputRead) The List class holds a number of probable target words, which are held in an array. It also contains a method, which returns a single word at random. THIS CLASS IS DONE. The Game class controls playing the game. It has a run() method to start the game. It should also show the...
6
5475
by: xhe | last post by:
I am using ffmpeg to convert video, this is a sample script: $str='/home/transla1/bin/ffmpeg -i /home/transla1/public_html/ cybertube/web/uploads/video/31_AK000005.AVI -s 240x180 -b 100k -ar 22050 -y /home/transla1/public_html/cybertube/web/uploads/video/ generated/31_70_AK000005.AVI.flv '; //exec($str); runExternal($str,$code); echo $code ;
0
8996
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8832
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9562
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9254
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8255
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6799
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2217
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.